k8s

package
v0.0.14 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2022 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
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

func AddFinalizer(object client.Object)

AddFinalizer adds the finalizer managed by this controller to a given Ingress. It does not make any calls to the API server.

func CDNClassAnnotationValue

func CDNClassAnnotationValue(object client.Object) string

CDNClassAnnotationValue returns the CDN class found within an Ingress' annotations

func CDNClassMatches

func CDNClassMatches(candidate string) bool

CDNClassMatches returns whether the candidate class matches the one being managed by this controller

func HasFinalizer

func HasFinalizer(object client.Object) bool

HasFinalizer returns whether a given Ingress has a finalizer managed by this controller

func HasGroupAnnotation

func HasGroupAnnotation(o client.Object) bool

HasGroupAnnotation returns whether the given Ingress has the CDN group annotation

func HasLoadBalancer

func HasLoadBalancer(o client.Object) bool

HasLoadBalancer returns whether the given Ingress has been provisioned

func IsBeingRemovedFromDesiredState

func IsBeingRemovedFromDesiredState(obj client.Object) bool

IsBeingRemovedFromDesiredState return whether the Ingress is being removed or if it no longer belongs to a group

func RemoveFinalizer

func RemoveFinalizer(object client.Object)

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 Path

type Path struct {
	PathPattern string
	PathType    string
}

Path represents a path item within an Ingress

type SharedIngressParams

type SharedIngressParams struct {
	WebACLARN string
}

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL