ctrlutils

package
v2.0.7 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2022 License: Apache-2.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CRDExists

func CRDExists(client client.Client, gvr schema.GroupVersionResource) bool

CRDExists returns false if CRD does not exist

func GeneratePredicateFuncsForIngressClassFilter

func GeneratePredicateFuncsForIngressClassFilter(name string, specCheckEnabled, annotationCheckEnabled bool) predicate.Funcs

GeneratePredicateFuncsForIngressClassFilter builds a controller-runtime reconciliation predicate function which filters out objects which do not have the "kubernetes.io/ingress.class" annotation configured and set to the provided value or in their .spec.

func HasAnnotation

func HasAnnotation(obj client.Object, key, expectedValue string) bool

HasAnnotation is a helper function to determine whether an object has a given annotation, and whether it's to the value provided.

func InSlice

func InSlice(e string, arr []string) bool

InSlice checks whether a string is present in a list of strings.

func IsIngressClassAnnotationConfigured

func IsIngressClassAnnotationConfigured(obj client.Object, expectedIngressClassName string) bool

IsIngressClassAnnotationConfigured determines whether an object has an ingress.class annotation configured that matches the provide IngressClassName (and is therefore an object configured to be reconciled by that class).

NOTE: keep in mind that the ingress.class annotation is deprecated and will be removed in a future release

of Kubernetes in favor of the .spec based implementation.

func IsIngressClassSpecConfigured

func IsIngressClassSpecConfigured(obj client.Object, expectedIngressClassName string) bool

IsIngressClassAnnotationConfigured determines whether an object has IngressClassName field in its spec and whether the value matches the provide IngressClassName (and is therefore an object configured to be reconciled by that class).

func MatchesIngressClassName

func MatchesIngressClassName(obj client.Object, ingressClassName string) bool

MatchesIngressClassName indicates whether or not an object indicates that it's supported by the ingress class name provided.

func PullConfigUpdate

func PullConfigUpdate(
	ctx context.Context,
	kongConfig sendconfig.Kong,
	log logr.Logger,
	kubeConfig *rest.Config,
	publishService string,
	publishAddresses []string,
)

PullConfigUpdate is a dedicated function that process ingress/customer resource status update after configuration is updated within kong.

func RunningAddresses

func RunningAddresses(ctx context.Context, kubeCfg *rest.Config, publishService string,
	publishAddresses []string) ([]string, string, error)

RunningAddresses retrieve cluster loader balance IP or hostaddress using networking

func SliceToStatus

func SliceToStatus(endpoints []string) []apiv1.LoadBalancerIngress

SliceToStatus converts a slice of IP and/or hostnames to LoadBalancerIngress

func UpdateIngress

func UpdateIngress(
	ctx context.Context,
	log logr.Logger,
	route *file.FRoute,
	cli *clientset.Clientset,
	ips []string,
) error

UpdateIngress networking v1 ingress status

func UpdateIngressLegacy

func UpdateIngressLegacy(
	ctx context.Context,
	log logr.Logger,
	route *file.FRoute,
	cli *clientset.Clientset,
	ips []string,
) error

UpdateIngressLegacy networking v1beta1 ingress status TODO: this can be removed once we no longer support old kubernetes < v1.19

func UpdateKnativeIngress

func UpdateKnativeIngress(ctx context.Context, log logr.Logger, svc file.FService, kubeCfg *rest.Config,
	ips []string, hostname string) error

UpdateKnativeIngress update knative ingress status

func UpdateStatuses

func UpdateStatuses(
	ctx context.Context,
	targetContent *file.Content,
	log logr.Logger,
	cli *clientset.Clientset,
	kiccli *kicclientset.Clientset,
	wg *sync.WaitGroup,
	ips []string,
	hostname string,
	kubeConfig *rest.Config,
	kubernetesVersion semver.Version,
) error

UpdateStatuses update resources statuses according to generated rules and specs

func UpdateTCPIngress

func UpdateTCPIngress(ctx context.Context, log logr.Logger, svc file.FService, kiccli *kicclientset.Clientset,
	ips []string) error

UpdateTCPIngress TCP ingress status

func UpdateUDPIngress

func UpdateUDPIngress(ctx context.Context, log logr.Logger, svc file.FService, kiccli *kicclientset.Clientset,
	ips []string) error

UpdateUDPIngress update udp ingress status

Types

This section is empty.

Jump to

Keyboard shortcuts

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