Skip to content
This repository has been archived by the owner on Jun 14, 2023. It is now read-only.

Runtime error when reconciling branches that contain capital letters #28

Open
Kaitou786 opened this issue Feb 24, 2021 · 0 comments
Open

Comments

@Kaitou786
Copy link
Contributor

When we create a GitRepository object and the repo contains any branch with any capital letter, the controller will give an runtimeError while creating the GitBranch object. This happens because we use branch.Name as part of the metedata.name of object, which is not allowed in kubenetes. You get error like:

invalid: metadata.name: Invalid value: "some-repo-KOGITO-2020": 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])?)*')

The easiest solution would be to convert the string to lower case(using strings.Lower()) before creating the object.
For reference in code see the line

@Kaitou786 Kaitou786 added the good first issue Good for newcomers label Feb 24, 2021
@moshloop moshloop removed the good first issue Good for newcomers label May 6, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants