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

Branch names ending in - are not handled correctly #209

Open
tobybellwood opened this issue Jun 8, 2023 · 2 comments
Open

Branch names ending in - are not handled correctly #209

tobybellwood opened this issue Jun 8, 2023 · 2 comments

Comments

@tobybellwood
Copy link
Member

ERROR	Reconciler error	{"controller": "lagoonbuild", "controllerGroup": "crd.lagoon.sh", "controllerKind": "LagoonBuild", "LagoonBuild": {"name":"lagoon-build-cfoqns","namespace":"lagoon"}, "namespace": "lagoon", "name": "lagoon-build-cfoqns", "reconcileID": "2f88479e-1410-4b6d-872e-ed9f670360b7", "error": "There was an error creating the namespace. Error was: Namespace \"ci-api-control-k8s-some-branch-name-\" is invalid: [metadata.name: Invalid value: \"ci-api-control-k8s-some-branch-name-\": a lowercase RFC 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])?'), metadata.labels: Invalid value: \"some-branch-name-\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?'), metadata.labels: Invalid value: \"ci-api-control-k8s-some-branch-name-\": a valid label must be an empty string or consist of alphanumeric characters, '-', '_' or '.', and must start and end with an alphanumeric character (e.g. 'MyValue',  or 'my_value',  or '12345', regex used for validation is '(([A-Za-z0-9][-A-Za-z0-9_.]*)?[A-Za-z0-9])?')]"}
@shreddedbacon
Copy link
Member

not sure how we can solve this. this is because things ending in a - are not valid dns for a namespace to use.

we could run it through a truncate/hashing function though?

@shreddedbacon
Copy link
Member

that would have to be done in remote-controller though, as this error is from that side of things

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

2 participants