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)
- func UsedDeprecatedFields(ing client.Object) []string
- func ValidateIngressFunctionAssociations(ing *networkingv1.Ingress) error
- type CDNClass
- type CDNClassFetcher
- type CDNIngress
- type FunctionAssociations
- type FunctionAssociationsPaths
- type FunctionType
- type IngressFetcher
- type OriginFunction
- type OriginRequestFunction
- type Path
- type SharedIngressParams
- type ViewerFunction
- type ViewerRequestFunction
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.
func UsedDeprecatedFields ¶ added in v0.4.0
func ValidateIngressFunctionAssociations ¶ added in v0.4.0
func ValidateIngressFunctionAssociations(ing *networkingv1.Ingress) error
Types ¶
type CDNClass ¶ added in v0.2.0
type CDNClass struct { // HostedZoneID of domain name HostedZoneID string // CreateAlias determine if should create an DNS alias or not CreateAlias bool // TXTOwnerValue the value to generate ownership TXT dns registry TXTOwnerValue 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 OriginHost string Group string UnmergedPaths []Path OriginReqPolicy string OriginHeaders map[string]string CachePolicy string OriginRespTimeout int64 AlternateDomainNames []string UnmergedWebACLARN 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(ctx context.Context, 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 FunctionAssociations ¶ added in v0.4.0
type FunctionAssociations struct { ViewerRequest *ViewerRequestFunction `yaml:"viewerRequest"` ViewerResponse *ViewerFunction `yaml:"viewerResponse"` OriginRequest *OriginRequestFunction `yaml:"originRequest"` OriginResponse *OriginFunction `yaml:"originResponse"` }
func (FunctionAssociations) IsEmpty ¶ added in v0.4.0
func (fa FunctionAssociations) IsEmpty() bool
func (FunctionAssociations) Merge ¶ added in v0.4.0
func (fa FunctionAssociations) Merge(other FunctionAssociations) (FunctionAssociations, error)
func (FunctionAssociations) Validate ¶ added in v0.4.0
func (fa FunctionAssociations) Validate() error
type FunctionAssociationsPaths ¶ added in v0.4.0
type FunctionAssociationsPaths struct {
Paths map[string]FunctionAssociations `yaml:",inline"`
}
type FunctionType ¶ added in v0.4.0
type FunctionType string
const ( FunctionTypeEdge FunctionType = "edge" FunctionTypeCloudfront FunctionType = "cloudfront" )
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 OriginFunction ¶ added in v0.4.0
type OriginFunction struct {
ARN string `yaml:"arn"`
}
type OriginRequestFunction ¶ added in v0.4.0
type OriginRequestFunction struct { OriginFunction `yaml:",inline"` IncludeBody bool `yaml:"includeBody"` }
type Path ¶
type Path struct { PathPattern string PathType string FunctionAssociations FunctionAssociations }
Path represents a path item within an Ingress
type SharedIngressParams ¶
type SharedIngressParams struct { // contains filtered or unexported fields }
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
func (SharedIngressParams) PathsFromOrigin ¶ added in v0.4.0
func (sp SharedIngressParams) PathsFromOrigin(originHost string) []Path
type ViewerFunction ¶ added in v0.4.0
type ViewerFunction struct { ARN string `yaml:"arn"` FunctionType FunctionType `yaml:"functionType"` }
type ViewerRequestFunction ¶ added in v0.4.0
type ViewerRequestFunction struct { ViewerFunction `yaml:",inline"` IncludeBody bool `yaml:"includeBody"` }