Bug 2070172 - SRO uses the chart's name as Helm release, not the SpecialResource's
Summary: SRO uses the chart's name as Helm release, not the SpecialResource's
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Special Resource Operator
Version: 4.11
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.11.0
Assignee: Quentin Barrand
QA Contact: Udi Kalifon
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-03-30 14:25 UTC by Quentin Barrand
Modified: 2022-08-10 11:03 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-08-10 11:02:42 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift special-resource-operator pull 194 0 None open Bug 2070172: Use the SpecialResource's name as Helm release 2022-05-06 08:49:17 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 11:03:01 UTC

Description Quentin Barrand 2022-03-30 14:25:28 UTC
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.

Comment 2 Quentin Barrand 2022-04-25 10:25:04 UTC
Merged upstream in https://github.com/openshift-psap/special-resource-operator/pull/286
PR downstream and backport TODO.

Comment 4 Udi Kalifon 2022-05-13 11:01:34 UTC
@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?

Comment 5 Quentin Barrand 2022-05-13 14:57:34 UTC
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.

Comment 7 Udi Kalifon 2022-06-21 15:23:06 UTC
Verified with the latest 4.11 code from bundle. I created 2 special resources from the same CMs.

Comment 8 errata-xmlrpc 2022-08-10 11:02:42 UTC
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


Note You need to log in before you can comment on or make changes to this bug.