Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restrict the format of managed cluster's name field. #177

Open
xuezhaojun opened this issue Jan 8, 2023 · 1 comment
Open

Restrict the format of managed cluster's name field. #177

xuezhaojun opened this issue Jan 8, 2023 · 1 comment

Comments

@xuezhaojun
Copy link
Member

Description

The name of managed clusters is often used as a unique identifier by a variety of components. But sometimes, it causes trouble. For example:

In cluster-proxy-addon, there is an ExternalName type Service on the agent-side using the cluster's name as its name field.

https://github.com/open-cluster-management-io/cluster-proxy/blob/ecc688e4d7abee732df6a478d9d1583646d767e5/pkg/proxyagent/agent/manifests/charts/addon-agent/templates/cluster-service.yaml#L6

When the cluster's name starts with a number, the work-agent will return the error:

E1223 09:27:20.700245 1 base_controller.go:270] "ManifestWorkAgent" controller failed to sync "addon-cluster-proxy-deploy-0", err: Service "20pi8725abdjf5lccjlt61dnqidp1bm2" is invalid: metadata.name: Invalid value: "20pi8725abdjf5lccjlt61dnqidp1bm2": a DNS-1035 label must consist of lower case alphanumeric characters or '-', start with an alphabetic character, and end with an alphanumeric character (e.g. 'my-name', or 'abc-123', regex used for validation is '[a-z]([-a-z0-9]*[a-z0-9])?')
@xuezhaojun
Copy link
Member Author

cc @elgnay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant