Documentation
¶
Index ¶
- func AnnotateTemplate(dep *appsv1.Deployment, key, val string)
- func CRC(val string) string
- func CRCBytes(val []byte) string
- func ConfigMapComparer(expected runtime.Object, found runtime.Object) bool
- func DebugDumpObj(obj runtime.Object)
- func DeploymentComparer(expected runtime.Object, found runtime.Object) bool
- func GetEnv(container *corev1.Container, envName string) *corev1.EnvVar
- func GetJsonPathValue(obj runtime.Object, jsonPath string) ([]byte, error)
- func GetJsonPathValueU(unstructured map[string]interface{}, jsonPath string) ([]byte, error)
- func IngressComparer(expected runtime.Object, found runtime.Object) bool
- func Int32Ptr(i int32) *int32
- func Int64Ptr(i int64) *int64
- func IsNuxeoAnnotation(annotationKey string) bool
- func IsOpenShift() bool
- func MergeOrAddEnvVar(container *corev1.Container, env corev1.EnvVar, separator string) error
- func NopComparer(runtime.Object, runtime.Object) bool
- func ObjectsDiffer(expected interface{}, actual interface{}) (bool, error)
- func OnlyAddContainer(dep *appsv1.Deployment, container corev1.Container) error
- func OnlyAddEnvVar(container *corev1.Container, env corev1.EnvVar) error
- func OnlyAddVol(dep *appsv1.Deployment, vol corev1.Volume) error
- func OnlyAddVolMnt(container *corev1.Container, mnt corev1.VolumeMount) error
- func PvcComparer(expected runtime.Object, found runtime.Object) bool
- func RouteComparer(expected runtime.Object, found runtime.Object) bool
- func SecretComparer(expected runtime.Object, found runtime.Object) bool
- func ServiceComparer(expected runtime.Object, found runtime.Object) bool
- func SetInt32If(v *int32, ifVal int32, thenVal int32)
- func SetIsOpenShift(isOpenShift bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateTemplate ¶ added in v0.7.1
func AnnotateTemplate(dep *appsv1.Deployment, key, val string)
Annotates the passed deployment.spec.template.annotations
func ConfigMapComparer ¶
ConfigMap comparer
func DebugDumpObj ¶
DebugDumpObj is used for debugging as needed. It dumps the YAML to the console for the passed object
func DeploymentComparer ¶
Deployment comparer
func GetJsonPathValue ¶
GetJsonPathValue applies the passed JSONPath expression to the passed runtime object and returns the result of the parse. It's less friendly than the kubectl get -o=jsonpath= in that the passed JSON path has to be in the canonical format: "{.path...}" meaning 1) enclosed in curly braces and 2) starting with a period. A variety of errors are returned but an empty return value and nil error can also indicate that the provided JSON path didn't find anything in the passed resource.
func GetJsonPathValueU ¶
Same as GetJsonPathValue, except takes an unstructured instead of a runtime object
func IngressComparer ¶
Ingress comparer (ingress annotations control passthrough) so - while these annotations are not part of the spec - if they change then its a reconcilement event.
func IsNuxeoAnnotation ¶ added in v0.7.1
returns true if the start of passed 'annotationKey' matches any Nuxeo annotation in common.NuxeoAnnotations
func IsOpenShift ¶
func IsOpenShift() bool
Returns true if the operator is running in an OpenShift cluster. Else false = Kubernetes. False by default, unless SetIsOpenShift() was called prior to this call
func MergeOrAddEnvVar ¶
MergeOrAddEnvVar searches the environment variable array in the passed container for an entry whose name matches the name of the passed environment variable struct. If found in the container array, the value of the passed variable is appended to the value of the existing variable, separated by the passed separator. Otherwise the passed environment variable struct is appended to the container env var array. E.g. given a container with an existing env var corev1.EnvVar{Name: "Z", Value "abc,123"}, then:
MergeOrAddEnvVar(someContainer, corev1.EnvVar{Name: "Z", Value "xyz,456"}, ",")
updates the variable value to: "abc,123,xyz,456". If either the passed environment variable or the existing one (by name) is a 'ValueFrom' environment variable then an error is returned.
func NopComparer ¶
objects are always the same
func ObjectsDiffer ¶
Used for debugging
func OnlyAddContainer ¶
func OnlyAddContainer(dep *appsv1.Deployment, container corev1.Container) error
Adds the passed container to the passed deployment if not present in the deployment, otherwise errors
func OnlyAddEnvVar ¶
Adds the passed environment variable to the passed container if not present, otherwise errors
func OnlyAddVol ¶
func OnlyAddVol(dep *appsv1.Deployment, vol corev1.Volume) error
Adds the passed volume to the passed deployment if not present in the container, otherwise errors
func OnlyAddVolMnt ¶
func OnlyAddVolMnt(container *corev1.Container, mnt corev1.VolumeMount) error
Adds the passed volume mount to the passed container if not present in the container, otherwise errors
func PvcComparer ¶
PersistentVolumeClaim comparer
func RouteComparer ¶
OpenShift Route comparer
func SecretComparer ¶
Secret comparer (operator may annotate secrets)
func ServiceComparer ¶
Service comparer (Kubernetes will update components of the service spec with values it chooses so the comparer has to ignore those)
func SetInt32If ¶
set v = thenVal if v == ifVal
func SetIsOpenShift ¶
func SetIsOpenShift(isOpenShift bool)
Sets operator state indicating that the operator believes it is running in an OpenShift cluster.
Types ¶
This section is empty.