When installing separate instances in different namespaces of one k8s with helm chart, I met with CRD confliction

Error: INSTALLATION FAILED: Unable to continue with install: CustomResourceDefinition “controlplanerequestlimits.consul.hashicorp.com” in namespace “” exists and cannot be imported into the current release: invalid ownership metadata; annotation validation error: key “meta.helm.sh/release-name” must equal “another”: current value is “consul”; annotation validation error: key “meta.helm.sh/release-namespace” must equal “another”: current value is “consul”

Helm detects that these CRDs already exist from the first installation, so it flags an error. I suggest to use a different release names for the second helm installation.

I have already created a new namespace and used a new release name, still met with the problem. It maybe a bug in helm: // Install requires an extra validation step of checking that resources
// don’t already exist before we actually create resources. If we continue
// forward and create the release object with resources that already exist,
// we’ll end up in a state where we will delete those resources upon
// deleting the release because the manifest will be pointing at that
// resource
if !i.ClientOnly && !isUpgrade && len(resources) > 0 {
//toBeAdopted, err = existingResourceConflict(resources, rel.Name, rel.Namespace)
if err != nil {
return nil, errors.Wrap(err, “Unable to continue with install”)
}
}
Helm should detect namespace-scoped CRDs confliction limited to the same namespace but not in cluster scope. When I commented the codes above and rebuild helm , the installatiion pass.