k8sutils

package
v0.0.0-...-cc8e7a3 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const WaitTimeout = 2 * time.Minute

WaitTimeout is the time we're waiting before considering an operation failed.

Variables

This section is empty.

Functions

func IngressGetSecretKeysFromAnnotation

func IngressGetSecretKeysFromAnnotation(ingress *extensionsv1beta1.Ingress, defaultSecretTLSKeyType, defaultSecretTLSCertType string) (tlsKeySecretKey, tlsCertSecretKey string)

IngressGetSecretKeysFromAnnotation ....

func IngressHasAnnotation

func IngressHasAnnotation(ingress *extensionsv1beta1.Ingress, annotation string) bool

IngressHasAnnotation checks whether the given ingres has the annotation.

func IngressHasDeletionTimestamp

func IngressHasDeletionTimestamp(ingress *extensionsv1beta1.Ingress) bool

IngressHasDeletionTimestamp checks whether the ingress has a deletion timestamp set.

func IngressHasFinalizer

func IngressHasFinalizer(ingress *extensionsv1beta1.Ingress, finalizer string) bool

IngressHasFinalizer checks whether the given ingress has a finalizer.

func IsLastHostInIngressSpec

func IsLastHostInIngressSpec(ingress *extensionsv1beta1.Ingress, hostName string) bool

IsLastHostInIngressSpec checks if 'hostName' is the last host in ingress.Spec.TLS

Types

type K8sFramework

type K8sFramework struct {
	*kubernetes.Clientset
	// contains filtered or unexported fields
}

K8sFramework ...

func NewK8sFramework

func NewK8sFramework(opts config.Options, logger log.Logger) (*K8sFramework, error)

NewK8sFramework returns a new k8s framework.

func (*K8sFramework) AddIngressInformerEventHandler

func (k8s *K8sFramework) AddIngressInformerEventHandler(addFunc, deleteFunc func(obj interface{}), updateFunc func(oldObj, newObj interface{}))

AddIngressInformerEventHandler adds event handlers to the ingress informer.

func (*K8sFramework) AddSecretInformerEventHandler

func (k8s *K8sFramework) AddSecretInformerEventHandler(addFunc, deleteFunc func(obj interface{}), updateFunc func(oldObj, newObj interface{}))

AddSecretInformerEventHandler adds event handlers to the secret informer.

func (*K8sFramework) CreateSecret

func (k8s *K8sFramework) CreateSecret(secret *corev1.Secret) error

CreateSecret create the given Secret and waits until the operation times out or is completed.

func (*K8sFramework) DeleteSecret

func (k8s *K8sFramework) DeleteSecret(secret *corev1.Secret) error

DeleteSecret deletes an existing secret and waits until the operation times out or is completed.

func (*K8sFramework) EnsureVicePresidentFinalizerExists

func (k8s *K8sFramework) EnsureVicePresidentFinalizerExists(ingress *extensionsv1beta1.Ingress) error

EnsureVicePresidentFinalizerExists ensures the Finalizer exists on the given Ingress or returns an error.

func (*K8sFramework) EnsureVicePresidentFinalizerRemoved

func (k8s *K8sFramework) EnsureVicePresidentFinalizerRemoved(ingress *extensionsv1beta1.Ingress) error

EnsureVicePresidentFinalizerRemoved ensures the Finalizer was removed from the given Ingress or returns an error.

func (*K8sFramework) Eventf

func (k8s *K8sFramework) Eventf(object runtime.Object, eventType, reason, messageFmt string, args ...interface{})

Eventf emits an event via the event recorder.

func (*K8sFramework) GetIngress

func (k8s *K8sFramework) GetIngress(namespace, name string) (*extensionsv1beta1.Ingress, error)

GetIngress returns the ingress or an error.

func (*K8sFramework) GetIngressFromIndexerByKey

func (k8s *K8sFramework) GetIngressFromIndexerByKey(key string) (interface{}, bool, error)

GetIngressFromIndexerByKey gets an ingress from the ingress informer indexer by key.

func (*K8sFramework) GetIngressInformerStore

func (k8s *K8sFramework) GetIngressInformerStore() cache.Store

GetIngressInformerStore returns a the store of the ingress informer.

func (*K8sFramework) GetOrCreateSecret

func (k8s *K8sFramework) GetOrCreateSecret(namespace, name string, labels, annotations map[string]string) (*corev1.Secret, error)

GetOrCreateSecret returns an existing Secret or creates it if not found and waits until the operation times out or is completed.

func (*K8sFramework) RemoveIngressAnnotation

func (k8s *K8sFramework) RemoveIngressAnnotation(ingress *extensionsv1beta1.Ingress, annotation string) error

RemoveIngressAnnotation removes the given annotation from an ingress and waits until operation times out or is completed.

func (*K8sFramework) RemoveSecretAnnotation

func (k8s *K8sFramework) RemoveSecretAnnotation(secret *corev1.Secret, annotation string) error

RemoveSecretAnnotation removes an annotation from the given secret.

func (*K8sFramework) Run

func (k8s *K8sFramework) Run(stopCh <-chan struct{})

Run starts the informers.

func (*K8sFramework) UpdateIngress

func (k8s *K8sFramework) UpdateIngress(oldIngress, newIngress *extensionsv1beta1.Ingress, conditionFuncs ...watch.ConditionFunc) error

UpdateIngress updates an existing Ingress and waits until the operation times out or is completed.

func (*K8sFramework) UpdateSecret

func (k8s *K8sFramework) UpdateSecret(oldSecret, newSecret *corev1.Secret, conditionFuncs ...watch.ConditionFunc) error

UpdateSecret updates an existing Secret and waits until the operation times out or is completed.

func (*K8sFramework) WaitForCacheSync

func (k8s *K8sFramework) WaitForCacheSync(stopCh <-chan struct{}) bool

WaitForCacheSync returns true if all informer caches have been synced.

Jump to

Keyboard shortcuts

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