Bug 2016425 - Adoption controller generating invalid metadata.Labels for an already adopted Subscription resource
Summary: Adoption controller generating invalid metadata.Labels for an already adopted...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: OLM
Version: 4.9
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: ---
: 4.11.0
Assignee: Per da Silva
QA Contact: kuiwang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-10-21 13:52 UTC by tflannag
Modified: 2022-08-10 10:39 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Cause: Invalid Subscription labels were being generated when resource name was greater than 63 characters Consequence: An invalid Subscription was being created Fix: Truncated the label for cases that would exceed the 63 character limit Result: Subscription resource no longer rejected my Kubernetes API
Clone Of:
Environment:
Last Closed: 2022-08-10 10:39:06 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift operator-framework-olm pull 285 0 None Merged Sync 04 11 2022-05-12 01:10:49 UTC
Github operator-framework operator-lifecycle-manager pull 2430 0 None open Fix the subscription annotation 2021-11-24 13:00:17 UTC
Red Hat Product Errata RHSA-2022:5069 0 None None None 2022-08-10 10:39:33 UTC

Description tflannag 2021-10-21 13:52:22 UTC
Description of problem:
The adoption controller failed to adopt an already existing (and appears to already have been adopted) Subscription when generating the adoption metadata.Labels:

```
{"level":"error","ts":1634738113.834287,"logger":"controllers.adoption","msg":"Error adopting Subscription","request":"openshift-special-resource-operator/sro-operator-subscription","error":"Subscription.operators.coreos.com \"sro-operator-subscription\" is invalid: metadata.labels: Invalid value: \"operators.coreos.com/openshift-special-resource-operator.openshift-special-resource-\": name part must consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyName',  or 'my.name',  or '123-abc', regex used for validation is '([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9]')","stacktrace":"sigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).Reconcile\n\t/build/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:114\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).reconcileHandler\n\t/build/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:311\nsigs.k8s.io/controller-runtime/pkg/internal/controller.(*Controller).processNextWorkItem\n\t/build/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/build/vendor/sigs.k8s.io/controller-runtime/pkg/internal/controller/controller.go:227"}
```

Link to a CI job that contains more context: https://prow.ci.openshift.org/view/gs/origin-ci-test/pr-logs/pull/openshift-kni_cnf-features-deploy/750/pull-ci-openshift-kni-cnf-features-deploy-master-e2e-gcp-ran-profile/1450809562331353088

Version-Release number of selected component (if applicable):
4.9

How reproducible:
Unknown

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 3 Per da Silva 2022-04-08 12:46:48 UTC
Seems the upstream PR is stale and open since October. We should just close it and take over.

Comment 5 Per da Silva 2022-04-19 13:30:10 UTC
This has merged downstream! It's ready for QA.

Comment 9 errata-xmlrpc 2022-08-10 10:39:06 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.