KB-10 Confirmed
releaseNamespace and targetNamespace do not set the namespace of rendered objects
Behavior#
convoy applies a namespaced object without metadata.namespace to the default namespace:
- Helm content:
releaseNamespacesets only.Release.Namespacein the templates. - Manifests content:
targetNamespaceis not used by the renderer.
A comment in the Helm renderer says that the deployer adds the namespace. The deployer adds
default.
Effect#
Objects of a chart that does not write {{ .Release.Namespace }} into metadata.namespace go to
default, not to releaseNamespace. The same is true for manifests without a namespace.
Workaround#
Set metadata.namespace in the source, or add it with a mutation. For manifests, kustomize
content with targetNamespace sets the namespace.
Fix direction#
Set the namespace of namespaced objects without one to releaseNamespace or targetNamespace.
In the code
convoy v0.9.0
internal/render.renderHelminternal/render/helm.go:43internal/controller/release.resourceForinternal/controller/release/deployer.go:121