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

Service name generation fails due to RFC 1123 subdomain validation schema #247

Open
samox73 opened this issue Oct 18, 2024 · 1 comment
Open
Labels
bug Something isn't working

Comments

@samox73
Copy link

samox73 commented Oct 18, 2024

The doc (https://docs.otterize.com/reference/service-identities#kubernetes-service-identity-resolution) states that the service name for pods w/o the service-name annotation is generated according to their root owner name. All the . in this name are replaced by _. However when applying the generated ClientIntents, this fails with

The ClientIntents "some-service_v0_0_1" is invalid: metadata.name: Invalid value: "some-service_v0_0_1": a lowercase RFC 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])?)*')

when this root owner's name is e.g. some-service.v0.0.1, which can be the case for some CRDs. In my case it was the ClusterServiceVersion of the OLM, where it is common to name the CSV according to the version, see https://olm.operatorframework.io/docs/concepts/crds/clusterserviceversion/

My proposal would be to replace all . in the root owner name with - instead to conform to this specification, making the automated generation and application of ClientIntents more resilient, without manual intervention.

@orishoshan
Copy link
Contributor

Hey @samox73, thanks for the issue!

Indeed, you are correct - when generating the metadata.name we should use a different pattern, as you suggest. We'll be making this change soon :)

@orishoshan orishoshan added the bug Something isn't working label Oct 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants