Use .Release.Namespace instead of .Release.Name as a prefix for cluster-scoped objects #1257
Description
Right now cf-operator.fullname
prefixes the chart name with the release name and not the namespace:
This is used to create names for e.g. cluster roles and cluster rolebindings. The problem is that with helm 3 the release name is no longer unique (and it wasn't with helm 2 either if you had more than one tiller
instance).
So you can have a cf-operator
release in both ns1
and ns2
. Both will try to create a cluster role called cf-operator-quarks-cluster
(among others for job
, secret
, and statefulset
), creating a collision.
If you prefix with the namespace, the role and rolebinding will be ns1-quarks-cluster
and ns2-quarks-cluster
, which can be removed independently when their corresponding release is removed from ns1
or ns2
.
Given that the namespace-scoped objects don't include the release name in their object names, it isn't supported to install multiple releases of the same quarks chart into the same namespace anyways, so dropping the release name from the objects should not be an issue.
The kubecf
cluster-scoped objects have the same problem, but I thought I would raise it here first.