Documentation ¶
Index ¶
- Constants
- func AddFinalizer(object client.Object)
- func CDNClassAnnotationValue(object client.Object) string
- func CDNClassMatches(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 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" )
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 CDNClassMatches ¶
CDNClassMatches returns whether the candidate class matches the one being managed by this controller
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 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 }
CDNIngress represents an Ingress within the bounded context of cdn-origin-controller
func NewCDNIngressFromV1 ¶
func NewCDNIngressFromV1(ing *networkingv1.Ingress) CDNIngress
NewCDNIngressFromV1 creates a new CDNIngress from a v1 Ingress
func NewCDNIngressFromV1beta1 ¶
func NewCDNIngressFromV1beta1(ing *networkingv1beta1.Ingress) CDNIngress
NewCDNIngressFromV1beta1 creates a CDNIngress from a v1beta1 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, 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
func NewIngressFetcherV1Beta1 ¶
func NewIngressFetcherV1Beta1(k8sClient client.Client) IngressFetcher
NewIngressFetcherV1Beta1 creates an IngressFetcher that works with v1beta1 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