Skip to content
Andrew Pantuso edited this page Jan 12, 2022 · 1 revision

Problematic configuration:

1. An invalid namespace name is used for targetNamespace or namespaces

# addon.yaml
targetNamespace: redhat-foo-operator-
namespaces:
  - redhat-foo-operator-
  - redhat-other*operator

For both targetNamespace and namespaces names were used which do not conform to the kubernetes naming standards for name space:

  • redhat-foo-operator- contains a trailing slash.
  • redhat-other*operator contains a '*' character

2. An invalid label name is used for label, commonLabels, or namespaceLabels

# addon.yaml
label: api.openshift.com/
namespaceLabels:
  example*com/foo-label: true
commonLabels:
  /foo-label: true
  example.com./foo-label: true

For all the above labels there are non-conforming names:

  • api.openshift.com/ is a valid prefix, but has an empty name
  • example*com/foo-label includes a '*' character in the prefix
  • /foo-label is a valid name, but has an empty prefix
  • example.com./foo-label has an invalid prefix which is suffixed with a '.'

Note: while example.com. is a valid DNS domain kubernetes only accepts subdomains which makes the addition of the root domain '.' invalid

3. An invalid annotation name is used for commonAnnotations or namespaceAnnotations

# addon.yaml
namespaceAnnotations:
  example*com/foo-annotation: true
commonAnnotations:
  /foo-annotation: true
  example.com./foo-annotation: true

For all the above annotations there are non-conforming names:

  • example*com/foo-annotation includes a '*' character in the prefix
  • /foo-annotation is a valid name, but has an empty prefix
  • example.com./foo-annotation has an invalid prefix which is suffixed with a '.'

Correct configuration:

# addon.yaml
targetNamespace: redhat-foo-operator
label: api.openshift.com/foo-operator
namespaces:
  - redhat-foo-operator
  - redhat-other-operator
namespaceAnnotations:
  example.com/foo-annotation: true
namespaceLabels:
  example.com/foo-label: true
commonAnnotations:
  example.com/foo-annotation: true
commonLabels:
  example.com/foo-label: true
  • All namespaces conform to kubernetes naming standards
  • All annotations conform to kubernetes naming standards
  • All labels conform to kubernetes naming standards

Related resources:

kubernetes naming standards

Clone this wiki locally