common

package
v1.23.12 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// FinalizerKey is the string representing the Ingress finalizer.
	FinalizerKey = "networking.gke.io/ingress-finalizer"
	// FinalizerKeyV2 is the string representing the Ingress finalizer version.
	// Ingress with V2 finalizer uses V2 frontend naming scheme.
	FinalizerKeyV2 = "networking.gke.io/ingress-finalizer-V2"
	// TODO remove the 2 definitions once they are added in legacy-cloud-providers/gce
	// LegacyILBFinalizer key is used to identify ILB services whose resources are managed by service controller.
	LegacyILBFinalizer = "gke.networking.io/l4-ilb-v1"
	// ILBFinalizerV2 is the finalizer used by newer controllers that implement Internal LoadBalancer services.
	ILBFinalizerV2 = "gke.networking.io/l4-ilb-v2"
	// NegFinalizerKey is the finalizer used by neg controller to ensure NEG CRs are deleted after corresponding negs are deleted
	NegFinalizerKey = "networking.gke.io/neg-finalizer"
	// LegacyNetLBFinalizer key is used to identify L4 External LoadBalancer services whose resources are managed by service controller.
	LegacyNetLBFinalizer = "gke.networking.io/l4-netlb-v1"
	// NetLBFinalizerV2 is the finalizer used by newer controllers that manage L4 External LoadBalancer services.
	NetLBFinalizerV2 = "gke.networking.io/l4-netlb-v2"
)

Variables

Functions

func ContentHash

func ContentHash(s string, n int) string

ContentHash creates a content hash string of length n of s utilizing sha256. WARNING: PLEASE DO NOT CHANGE THE HASH FUNCTION.

func EnsureDeleteFinalizer

func EnsureDeleteFinalizer(ing *v1.Ingress, ingClient client.IngressInterface, finalizerKey string) error

EnsureDeleteFinalizer ensures that the specified finalizer is deleted from given Ingress.

func EnsureDeleteServiceFinalizer added in v1.9.0

func EnsureDeleteServiceFinalizer(service *corev1.Service, key string, kubeClient kubernetes.Interface) error

removeFinalizer patches the service to remove finalizer.

func EnsureFinalizer

func EnsureFinalizer(ing *v1.Ingress, ingClient client.IngressInterface, finalizerKey string) (*v1.Ingress, error)

EnsureFinalizer ensures that the specified finalizer exists on given Ingress.

func EnsureServiceFinalizer added in v1.9.0

func EnsureServiceFinalizer(service *corev1.Service, key string, kubeClient kubernetes.Interface) error

EnsureServiceFinalizer patches the service to add finalizer.

func HasFinalizer

func HasFinalizer(m meta_v1.ObjectMeta) bool

HasFinalizer is true if the passed in meta has an ingress finalizer.

func HasGivenFinalizer

func HasGivenFinalizer(m meta_v1.ObjectMeta, key string) bool

HasGivenFinalizer is true if the passed in meta has the specified finalizer.

func IngressKeyFunc

func IngressKeyFunc(ing *v1.Ingress) string

IngressKeyFunc returns ingress key for given ingress as generated by Ingress Store. This falls back to utility function in case of an error. Note: Ingress Store and NamespacedName both return same key in general. But, Ingress Store returns <name> where as NamespacedName returns /<name> when <namespace> is empty.

func IsDeletionCandidate

func IsDeletionCandidate(m meta_v1.ObjectMeta) bool

IsDeletionCandidate is true if the passed in meta contains an ingress finalizer.

func IsDeletionCandidateForGivenFinalizer

func IsDeletionCandidateForGivenFinalizer(m meta_v1.ObjectMeta, key string) bool

IsDeletionCandidateForGivenFinalizer is true if the passed in meta contains the specified finalizer.

func NamespacedName

func NamespacedName(ing *v1.Ingress) string

NamespacedName returns namespaced name string of a given ingress. Note: This is used for logging.

func PatchIngressObjectMetadata added in v1.10.0

func PatchIngressObjectMetadata(ic client.IngressInterface, ing *v1.Ingress, newObjectMetadata metav1.ObjectMeta) (*v1.Ingress, error)

PatchIngressObjectMetadata patches the given ingress's metadata based on new ingress metadata.

func PatchIngressStatus added in v1.10.0

func PatchIngressStatus(ic client.IngressInterface, ing *v1.Ingress, newStatus v1.IngressStatus) (*v1.Ingress, error)

PatchIngressStatus patches the given ingress's Status based on new ingress status.

func ToIngressKeys

func ToIngressKeys(ings []*v1.Ingress) []string

ToIngressKeys returns a list of ingress keys for given list of ingresses.

Types

This section is empty.

Jump to

Keyboard shortcuts

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