Documentation
¶
Index ¶
- Constants
- func AddFinalizer(object client.Object)
- func CDNClassAnnotationValue(object client.Object) string
- func CDNClassNotEmpty(candidate string) bool
- func HasFinalizer(object client.Object) bool
- func HasGroupAnnotation(o client.Object) bool
- func HasLoadBalancer(o client.Object) bool
- func IsBeingRemovedFromDesiredState(obj client.Object) bool
- func RemoveFinalizer(object client.Object)
- type CDNClass
- type CDNClassFetcher
- type CDNIngress
- type IngressFetcher
- type Path
- type SharedIngressParams
Constants ¶
const ( // CDNGroupAnnotation is the annotation key that represents a group of Ingresses composing a single Distribution CDNGroupAnnotation = "cdn-origin-controller.gympass.com/cdn.group" // CDNClassAnnotation is the annotation key that represents a class CDNClassAnnotation = "cdn-origin-controller.gympass.com/cdn.class" // CDNFinalizer is the finalizer to be used in Ingresses managed by the operator CDNFinalizer = "cdn-origin-controller.gympass.com/finalizer" )
const ( CFUserOriginAccessPublic = "Public" CFUserOriginAccessBucket = "Bucket" )
Variables ¶
This section is empty.
Functions ¶
func AddFinalizer ¶
AddFinalizer adds the finalizer managed by this controller to a given Ingress. It does not make any calls to the API server.
func CDNClassAnnotationValue ¶
CDNClassAnnotationValue returns the CDN class found within an Ingress' annotations
func CDNClassNotEmpty ¶ added in v0.2.0
CDNClassNotEmpty returns a boolean indicating if CDNClass is available
func HasFinalizer ¶
HasFinalizer returns whether a given Ingress has a finalizer managed by this controller
func HasGroupAnnotation ¶
HasGroupAnnotation returns whether the given Ingress has the CDN group annotation
func HasLoadBalancer ¶
HasLoadBalancer returns whether the given Ingress has been provisioned
func IsBeingRemovedFromDesiredState ¶
IsBeingRemovedFromDesiredState return whether the Ingress is being removed or if it no longer belongs to a group
func RemoveFinalizer ¶
RemoveFinalizer removes the finalizer managed by this controller from a given Ingress. It does not make any calls to the API server.
Types ¶
type CDNClass ¶ added in v0.2.0
type CDNClass struct {
// CertificateArn of domain name
CertificateArn string
// HostedZoneID of domain name
HostedZoneID string
}
CDNClass represents the domain object
type CDNClassFetcher ¶ added in v0.2.0
func NewCDNClassFetcher ¶ added in v0.2.0
func NewCDNClassFetcher(client client.Client) CDNClassFetcher
type CDNIngress ¶
type CDNIngress struct {
types.NamespacedName
LoadBalancerHost string
Group string
Paths []Path
ViewerFnARN string
OriginReqPolicy string
CachePolicy string
OriginRespTimeout int64
AlternateDomainNames []string
WebACLARN string
IsBeingRemoved bool
OriginAccess string
Class CDNClass
Tags map[string]string
}
CDNIngress represents an Ingress within the bounded context of cdn-origin-controller
func NewCDNIngressFromV1 ¶
func NewCDNIngressFromV1(ing *networkingv1.Ingress, class CDNClass) (CDNIngress, error)
NewCDNIngressFromV1 creates a new CDNIngress from a v1 Ingress
func (CDNIngress) GetName ¶
func (c CDNIngress) GetName() string
GetName returns the CDNIngress name
func (CDNIngress) GetNamespace ¶
func (c CDNIngress) GetNamespace() string
GetNamespace returns the CDNIngress namespace
type IngressFetcher ¶
type IngressFetcher interface {
// FetchBy fetches all Ingresses and returns a slice of the ones matching the given predicate.
// User-supplied origins present in annotations of these Ingresses are also included in the output.
FetchBy(ctx context.Context, cdnClass CDNClass, predicate func(CDNIngress) bool) ([]CDNIngress, error)
}
IngressFetcher interacts with Kubernetes to fetch networking.k8s.io Ingress resources
func NewIngressFetcherV1 ¶
func NewIngressFetcherV1(k8sClient client.Client) IngressFetcher
NewIngressFetcherV1 creates an IngressFetcher that works with v1 Ingreses
type SharedIngressParams ¶
type SharedIngressParams struct {
}
SharedIngressParams represents parameters which might be specified in multiple Ingresses
func NewSharedIngressParams ¶
func NewSharedIngressParams(ingresses []CDNIngress) (SharedIngressParams, error)
NewSharedIngressParams creates a new SharedIngressParams from a slice of CDNIngress