Bug 1924961 - k8sutil.TrimDNS1123Label creates invalid values
Summary: k8sutil.TrimDNS1123Label creates invalid values
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: Operator SDK
Version: 4.7
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 4.7.0
Assignee: Jesus M. Rodriguez
QA Contact: Fan Jia
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-02-04 01:46 UTC by Jesus M. Rodriguez
Modified: 2021-02-24 15:58 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: No Doc Update
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-02-24 15:58:08 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github openshift ocp-release-operator-sdk pull 98 0 None closed Bug 1924961: Fixed invalid object names generated for long package names 2021-02-10 15:47:39 UTC
Red Hat Product Errata RHSA-2020:5633 0 None None None 2021-02-24 15:58:57 UTC

Description Jesus M. Rodriguez 2021-02-04 01:46:56 UTC
## Bug Report

#### What did you do?
```
operator-sdk run bundle --install-mode AllNamespaces -n proactive-node-scaling-operator quay.io/$repo/proactive-node-scaling-operator-bundle:latest
I0202 10:50:13.277327   46403 request.go:645] Throttling request took 1.051324502s, request: GET:https://api.control-cluster-raffa.demo.red-chesterfield.com:6443/apis/authentication.k8s.io/v1beta1?timeout=32s
FATA[0010] Failed to run bundle: create catalog: error creating registry pod: error creating registry pod: create registry pod: Pod "-raffaelespazzoli-proactive-node-scaling-operator-bundle-latest" is invalid: metadata.name: Invalid value: "-raffaelespazzoli-proactive-node-scaling-operator-bundle-latest": 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])?)*') 
```
I never got this error before. The catalog source pod name is clearly wrong: `-raffaelespazzoli-proactive-node-scaling-operator-bundle-latest`, I probably made some mistake somewhere. How is that name generated?

#### What did you expect to see?

Working bundle

#### What did you see instead? Under which circumstances?
```
Invalid value: "-raffaelespazzoli-proactive-node-scaling-operator-bundle-latest": 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

**Operator type:**

<!-- Uncomment one or more of the following lines corresponding to the language of the operator type -->

/language go
<!-- /language ansible -->
<!-- /language helm -->

**Kubernetes cluster type:**

Unknown

`$ operator-sdk version`
```
operator-sdk version
operator-sdk version: "v1.3.0", commit: "1abf57985b43bf6a59dcd18147b3c574fa57d3f6", kubernetes version: "1.19.4", go version: "go1.15.5", GOOS: "linux", GOARCH: "amd64
```

`$ go version` (if language is Go)
1.15.5

`$ kubectl version`

N/A

#### Possible Solution

<!-- Only if you have suggestions on a fix for the bug -->

#### Additional context

<!-- Add any other context about the problem here. -->

Comment 4 errata-xmlrpc 2021-02-24 15:58:08 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 (Moderate: OpenShift Container Platform 4.7.0 security, bug fix, and enhancement 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-2020:5633


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