util

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Feb 15, 2022 License: Apache-2.0 Imports: 18 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const AnnotationBase = "cert-utils-operator.redhat-cop.io"
View Source
const CA = "ca.crt"
View Source
const CABundle = "ca-bundle.crt"
View Source
const Cert = "tls.crt"
View Source
const CertAnnotationSecret = AnnotationBase + "/injectca-from-secret"
View Source
const Key = "tls.key"
View Source
const TLSSecret = "kubernetes.io/tls"

Variables

View Source
var IsAnnotatedForSecretCAInjection = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		oldSecret, _ := e.ObjectOld.GetAnnotations()[CertAnnotationSecret]
		newSecret, _ := e.ObjectNew.GetAnnotations()[CertAnnotationSecret]
		return oldSecret != newSecret
	},
	CreateFunc: func(e event.CreateEvent) bool {
		_, ok1 := e.Object.GetAnnotations()[CertAnnotationSecret]
		return ok1
	},
}
View Source
var IsCAContentChanged = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		oldSecret, ok := e.ObjectOld.(*corev1.Secret)
		if !ok {
			return false
		}
		newSecret, ok := e.ObjectNew.(*corev1.Secret)
		if !ok {
			return false
		}
		if newSecret.Type != TLSSecret {
			return false
		}
		return !reflect.DeepEqual(newSecret.Data[CA], oldSecret.Data[CA])
	},
	CreateFunc: func(e event.CreateEvent) bool {
		secret, ok := e.Object.(*corev1.Secret)
		if !ok {
			return false
		}
		if secret.Type != TLSSecret {
			return false
		}
		return true
	},
}

Functions

func GetSecretCA

func GetSecretCA(c client.Client, secretName string, secretNamespace string) ([]byte, error)

func NewEnqueueRequestForReferecingObject

func NewEnqueueRequestForReferecingObject(config *rest.Config, gvk schema.GroupVersionKind) *enqueueRequestForReferecingObject

func ValidateConfigMapName

func ValidateConfigMapName(configMapNamespacedName string) error

func ValidateSecretName

func ValidateSecretName(secretNamespacedName string) error

Types

This section is empty.

Jump to

Keyboard shortcuts

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