operator-framework / operator-lifecycle-manager

A management framework for extending Kubernetes with Operators
https://olm.operatorframework.io
Apache License 2.0
1.72k stars 545 forks source link

Auto-provisioned Subscriptions do not support upper-case characters in channel names #1559

Open cdjohnson opened 4 years ago

cdjohnson commented 4 years ago

Bug Report

What did you do?

  1. Create an operator with default channel: V1.0
  2. Create a second operator that depends on the first operator's API in the CSV
  3. Install the second operator via a subscription.

What did you expect to see? Both the first and second operator should be installed successfully, where the first operator is installed using the default channel.

What did you see instead? Under which circumstances? When OLM attempts to create the second subscription in the installplan, it auto-generates a subscription name in the format: <operatorname>-<channel>-<catalogname>-<catalognamespace>

The problem is that the Channel name is NOT lower-cased, resulting in an error in the status section: error creating subscription: myoperator-V1.0-mycatalog-openshift-marketplace: Subscription.operators.coreos.com "myoperator-V1.0-mycatalog-openshift-marketplace" is invalid: metadata.namee: Invalid value: "myoperator-V1.0-mycatalog-openshift-marketplace" a DNS-1123 subdomain must consist of lower case alphanumeric characters, '-' or '.', and must start and end with an alphanumeric character (e.g. 'example.com', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*')

Environment

Possible Solution use lower-case channels

Additional context

awgreene commented 4 years ago

Hello @cdjohnson, it looks like you created a Subscription where the metadata.name field, myoperator-V1.0-mycatalog-openshift-marketplace, includes an Upper Case letter, Kubernetes does not support Upper Case letters in names, example:

$ kubectl create ns Test
The Namespace "Test" is invalid: metadata.name: Invalid value: "Test": a DNS-1123 label must consist of lower case alphanumeric characters or '-', and must start and end with an alphanumeric character (e.g. 'my-name',  or '123-abc', regex used for validation is '[a-z0-9]([-a-z0-9]*[a-z0-9])?')
awgreene commented 4 years ago

Sorry - just saw that OLM is generating the subscription that is failing. This is valid.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jeyaramashok commented 4 years ago

@awgreene I am interested to work on this. Can you please assign this issue to me ? , if it's not already worked on

I noticed you have created PR: https://github.com/operator-framework/operator-lifecycle-manager/pull/1560 previously to address this but it wasn't merged

jeyaramashok commented 4 years ago

created PR https://github.com/operator-framework/operator-lifecycle-manager/pull/1864 to address this issue

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

jeyaramashok commented 3 years ago

bump to keep issue alive, added PR https://github.com/operator-framework/operator-lifecycle-manager/pull/1864 to address this issue