Documentation ¶
Index ¶
- Constants
- func AddOwnerReference(owner v1.Object, object v1.Object, scheme *runtime.Scheme) error
- func AppendEnvVarValue(container *corev1.Container, name string, value string)
- func ApplyAnnotation(meta *v1.ObjectMeta, key string, value string)
- func ApplyConfigMapHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, ...) error
- func ApplyConfigMapVolume(pod *corev1.PodSpec, name string, configMapName string)
- func ApplyConfigMapVolumeItems(pod *corev1.PodSpec, name string, configMapName string, ...)
- func ApplyContainerImage(container *corev1.Container, imageName string, override *v1beta1.ImageOverride) error
- func ApplyContainerWithError(containers []corev1.Container, name string, ...) ([]corev1.Container, error)
- func ApplyCustomLabel(meta *v1.ObjectMeta, key string, value string)
- func ApplyDefaultLabels(meta *v1.ObjectMeta, component string, name string)
- func ApplyDeploymentContainerWithError(deployment *appsv1.Deployment, name string, ...) error
- func ApplyDeploymentDefaults(deployment *appsv1.Deployment, component string, name string)
- func ApplyEmptyDirVolume(pod *corev1.PodSpec, name string)
- func ApplyEnv(container *corev1.Container, name string, mutator func(envvar *corev1.EnvVar))
- func ApplyEnvConfigMap(container *corev1.Container, name string, configMapKey string, ...)
- func ApplyEnvOptionalSecret(container *corev1.Container, name string, secretKey string, secretName string, ...)
- func ApplyEnvSecret(container *corev1.Container, name string, secretKey string, secretName string)
- func ApplyEnvSimple(container *corev1.Container, name string, value string)
- func ApplyEnvWithError(container *corev1.Container, name string, ...) error
- func ApplyHttpProbe(probe *corev1.Probe, initialDelaySeconds int32, path string, port uint16) *corev1.Probe
- func ApplyInitContainerWithError(deployment *appsv1.Deployment, name string, ...) error
- func ApplyJobContainerWithError(job *batchv1.Job, name string, mutator func(*corev1.Container) error) error
- func ApplyMetricsServiceDefaults(service *corev1.Service, component string, name string)
- func ApplyNodeAffinity(template *corev1.PodTemplateSpec, matchKey string)
- func ApplyOpenShiftServingCertAnnotation(annotations map[string]string, certName string, isOpenShift func() bool, ...)
- func ApplyOrRemoveEnvSimple(container *corev1.Container, name string, value string)
- func ApplyPersistentVolume(pod *corev1.PodSpec, name string, claimName string)
- func ApplySecretHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, ...) error
- func ApplySecretVolume(pod *corev1.PodSpec, name string, secretName string)
- func ApplyServiceDefaults(service *corev1.Service, component string, name string)
- func ApplyStatefulSetContainerWithError(statefulSet *appsv1.StatefulSet, name string, ...) error
- func ApplyStatefulSetDefaults(statefulset *appsv1.StatefulSet, component string, name string)
- func ApplyTlsSecret(secret *corev1.Secret, key []byte, certificate []byte)
- func ApplyVolume(pod *corev1.PodSpec, name string, mutator func(*corev1.Volume))
- func ApplyVolumeMount(container *corev1.Container, name string, ...)
- func ApplyVolumeMountSimple(container *corev1.Container, name string, path string, readOnly bool)
- func ApplyVolumeMountWithError(container *corev1.Container, name string, ...) error
- func ApplyVolumeWithError(pod *corev1.PodSpec, name string, mutator func(*corev1.Volume) error) error
- func BulkProcess(ctx context.Context, client client.Client, list runtime.Object, ...) (int, error)
- func BulkRemoveOwner(ctx context.Context, c client.Client, owner runtime.Object, controller bool, ...) (int, error)
- func ComputeConfigMapHash(cm corev1.ConfigMap) (hash string, err error)
- func CreateDefaultAnnotations(annotations map[string]string) map[string]string
- func CreateDefaultLabels(labels map[string]string, component string, name string) map[string]string
- func DeleteIgnoreNotFound(ctx context.Context, client client.Client, obj runtime.Object, ...) error
- func DeleteItemOperation(ctx context.Context, client client.Client, obj interface{}) error
- func DeleteOtherContainers(containers []corev1.Container, prefix string, expectedNames []string) []corev1.Container
- func DropContainer(deployment *appsv1.Deployment, name string)
- func DropVolume(pod *corev1.PodSpec, name string)
- func DropVolumeMount(container *corev1.Container, name string)
- func FromConfigMap(configMapName string, configMapKey string) *corev1.EnvVarSource
- func FromField(fieldPath string) *corev1.EnvVarSource
- func FromFieldNamespace() *corev1.EnvVarSource
- func FromOptionalConfigMap(configMapName string, configMapKey string, optional *bool) *corev1.EnvVarSource
- func FromOptionalSecret(secretName string, secretKey string, optional *bool) *corev1.EnvVarSource
- func FromSecret(secretName string, secretKey string) *corev1.EnvVarSource
- func IsDeleted(obj interface{}) (bool, error)
- func IsOwnedBy(owner runtime.Object, obj interface{}, controller bool) (bool, error)
- func LabelSelectorFromMap(l map[string]string) (labels.Selector, error)
- func OverrideProbe(override *corev1.Probe, target *corev1.Probe)
- func OverrideSecurityContextFsGroup(componentName string, securityContext *corev1.PodSecurityContext, ...)
- func RemoveEnv(container *corev1.Container, name string)
- func SetContainerImage(container *corev1.Container, imageName string, ...) error
- func UpdateItemOperation(ctx context.Context, client client.Client, obj interface{}) error
- type BulkItemEvaluator
- type BulkItemOperation
- type DeletePredicate
- type OwnerResult
- func DeleteIfOwnedBy(ctx context.Context, c client.Client, objectKey client.ObjectKey, ...) (OwnerResult, error)
- func ProcessOwnedBy(obj v1.Object, owner runtime.Object, controller bool, remove bool) (OwnerResult, error)
- func ProcessOwnedByObject(owner runtime.Object, obj interface{}, controller bool, remove bool) (OwnerResult, error)
- func RemoveAsOwner(owner runtime.Object, object interface{}, controller bool) (OwnerResult, error)
Constants ¶
const JavaOptsEnvVarName = "JAVA_APP_OPTS"
const ServingCertSecretNameAlpha = "service.alpha.openshift.io/serving-cert-secret-name"
const ServingCertSecretNameBeta = "service.beta.openshift.io/serving-cert-secret-name"
Variables ¶
This section is empty.
Functions ¶
func AddOwnerReference ¶
Ensure that an owner is set
func AppendEnvVarValue ¶
Append a string to the value of an env-var. If the env-var doesn't exist, it will be created with the provided value. A whitespace is added between the existing value and the new value.
func ApplyAnnotation ¶
func ApplyAnnotation(meta *v1.ObjectMeta, key string, value string)
func ApplyConfigMapHash ¶
func ApplyConfigMapHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, namespace string, configMapName string, keys ...string) error
Get the hash of the content of a config map, and apply this to the pod so that a change in the content of the config map will trigger a re-rollout.
func ApplyConfigMapVolume ¶
func ApplyContainerImage ¶
func ApplyContainerWithError ¶
func ApplyCustomLabel ¶
func ApplyCustomLabel(meta *v1.ObjectMeta, key string, value string)
Apply a custom label
func ApplyDefaultLabels ¶
func ApplyDefaultLabels(meta *v1.ObjectMeta, component string, name string)
Apply standard set of labels
func ApplyDeploymentDefaults ¶
func ApplyDeploymentDefaults(deployment *appsv1.Deployment, component string, name string)
Apply some default deployment values
func ApplyEmptyDirVolume ¶
func ApplyEnvConfigMap ¶
func ApplyEnvOptionalSecret ¶
func ApplyEnvSecret ¶
func ApplyEnvWithError ¶
func ApplyHttpProbe ¶
func ApplyHttpProbe(probe *corev1.Probe, initialDelaySeconds int32, path string, port uint16) *corev1.Probe
Apply a simple HTTP probe
func ApplyNodeAffinity ¶
func ApplyNodeAffinity(template *corev1.PodTemplateSpec, matchKey string)
func ApplyOrRemoveEnvSimple ¶
func ApplyPersistentVolume ¶
func ApplySecretHash ¶
func ApplySecretHash(c client.Client, pod *corev1.PodTemplateSpec, annotationName string, namespace string, secretName string, keys ...string) error
Get the hash of the content of a secret, and apply this to the pod so that a change in the content of the secret will trigger a re-rollout.
func ApplySecretVolume ¶
func ApplyServiceDefaults ¶
Apply some default service values
func ApplyStatefulSetDefaults ¶
func ApplyStatefulSetDefaults(statefulset *appsv1.StatefulSet, component string, name string)
Apply some default deployment values
func ApplyVolumeMount ¶
func ApplyVolumeMount(container *corev1.Container, name string, mutator func(mount *corev1.VolumeMount))
func ApplyVolumeMountSimple ¶
func ApplyVolumeWithError ¶
func BulkProcess ¶
func BulkProcess(ctx context.Context, client client.Client, list runtime.Object, opts client.ListOptions, evaluator BulkItemEvaluator) (int, error)
Bulk delete The "obj" provided must by a Kubernetes List type, having an "Items" field
func BulkRemoveOwner ¶
func BulkRemoveOwner(ctx context.Context, c client.Client, owner runtime.Object, controller bool, list runtime.Object, opts client.ListOptions) (int, error)
Process an object type, and remove the owner, from the owner list. If this was the last owner. Delete the object. The "obj" provided must by a Kubernetes List type, having an "Items" field It returns the number of entries found which did contain the owner of the provided object.
func CreateDefaultLabels ¶
func DeleteIgnoreNotFound ¶
func DeleteIgnoreNotFound(ctx context.Context, client client.Client, obj runtime.Object, opts ...client.DeleteOption) error
Delete object, ignore if it is already gone or the kind is unknown.
func DeleteItemOperation ¶
func DeleteOtherContainers ¶
func DeleteOtherContainers(containers []corev1.Container, prefix string, expectedNames []string) []corev1.Container
Delete all containers which are not expected
func DropContainer ¶
func DropContainer(deployment *appsv1.Deployment, name string)
func DropVolume ¶
func DropVolumeMount ¶
func FromConfigMap ¶
func FromConfigMap(configMapName string, configMapKey string) *corev1.EnvVarSource
func FromField ¶
func FromField(fieldPath string) *corev1.EnvVarSource
func FromFieldNamespace ¶
func FromFieldNamespace() *corev1.EnvVarSource
func FromOptionalConfigMap ¶
func FromOptionalConfigMap(configMapName string, configMapKey string, optional *bool) *corev1.EnvVarSource
func FromOptionalSecret ¶
func FromOptionalSecret(secretName string, secretKey string, optional *bool) *corev1.EnvVarSource
func FromSecret ¶
func FromSecret(secretName string, secretKey string) *corev1.EnvVarSource
func OverrideSecurityContextFsGroup ¶
func OverrideSecurityContextFsGroup(componentName string, securityContext *corev1.PodSecurityContext, target *appsv1.Deployment)
func SetContainerImage ¶
Types ¶
type BulkItemEvaluator ¶
type BulkItemEvaluator func(interface{}) (BulkItemOperation, error)
type BulkItemOperation ¶
type DeletePredicate ¶
type DeletePredicate func(interface{}) bool
type OwnerResult ¶
type OwnerResult int
const ( NotFound OwnerResult = iota Found FoundAndEmpty )
func DeleteIfOwnedBy ¶
func DeleteIfOwnedBy(ctx context.Context, c client.Client, objectKey client.ObjectKey, obj runtime.Object, owner runtime.Object, controller bool) (OwnerResult, error)
Delete an object, if it is owned by the owner. Otherwise leave it alone. If the object doesn't exists, this will be reported as an error which can be checked by IsNotFound(err)
func ProcessOwnedBy ¶
func ProcessOwnedBy(obj v1.Object, owner runtime.Object, controller bool, remove bool) (OwnerResult, error)
Function to check if an object is owned by another object
func ProcessOwnedByObject ¶
func ProcessOwnedByObject(owner runtime.Object, obj interface{}, controller bool, remove bool) (OwnerResult, error)
same as, ProcessOwnedBy, but handles interfaces (structured and unstructured)
func RemoveAsOwner ¶
func RemoveAsOwner(owner runtime.Object, object interface{}, controller bool) (OwnerResult, error)