Description of problem: SRO uses the recipe chart's name as Helm release, not the SpecialResource. This leads to issues with the meta.helm.sh/release-name annotation Helm is putting on the resource it owns. If two SpecialResources target the same chart, then both installations might fail as each one will adopt the other's resources through that annotation. Slack thread: https://coreos.slack.com/archives/C02358PSC03/p1647933385175109 Using the SpecialResource's name (which is unique in the cluster) instead of the chart's should solve this issue.
Merged upstream in https://github.com/openshift-psap/special-resource-operator/pull/286 PR downstream and backport TODO.
@quba I changed the chart's name in index.yaml and updated my configmap, and I also changed the specialresource's CRD so that the SR's name is simple-kmod-sr-name and the chart's name is simple-kmod-chart-name. I get this in the SRO log: cm-getter2022/05/13 10:25:51 Element: index.yaml 2022-05-13T10:25:51.612Z INFO helmer Locating {"chart": "example/simple-kmod-chart-name"} 2022-05-13T10:25:51.640Z ERROR controller.specialresource Reconciler error {"reconciler group": "sro.openshift.io", "reconciler kind": "SpecialResource", "name": "simple-kmod-sr-name", "namespace": "", "error": "RECONCILE ERROR: Cannot reconcile special resource: Could not locate chart example/simple-kmod-chart-name: chart \"simple-kmod-chart-name\" matching 0.0.1 not found in example index. (try 'helm repo update'): no chart name found", "errorVerbose": "Could not locate chart example/simple-kmod-chart-name: chart \"simple-kmod-chart-name\" matching 0.0.1 not found in example index. (try 'helm repo update'): no chart name found\nRECONCILE ERROR: Cannot reconcile special resource\ngithub.com/openshift-psap/special-resource-operator/controllers.(*SpecialResourceReconciler).Reconcile\n\t/workspace/controllers/specialresource_controller.go:94\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:266\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2\n\t/workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227\nruntime.goexit\n\t/usr/lib/golang/src/runtime/asm_amd64.s:1581"} sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Start.func2.2 /workspace/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227 How do I properly change the chart's name?
The make-cm-recipe script is the preferred way to create a ConfigMap-based recipe: https://github.com/openshift/special-resource-operator/blob/master/scripts/make-cm-recipe In that case, I think there was a mismatch between the name of the chart in the index (simple-kmod-chart-name) and the name in Chart.yaml. The script generates index.yaml and avoids potential errors there.
Verified with the latest 4.11 code from bundle. I created 2 special resources from the same CMs.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069