Skip to content

k8sutil.TrimDNS1123Label creates invalid values #4470

@jmrodri

Description

@jmrodri

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:

/language go

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

Additional context

Metadata

Metadata

Assignees

Labels

kind/bugCategorizes issue or PR as related to a bug.language/goIssue is related to a Go operator project

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions