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
When we create a
GitRepositoryobject and the repo contains any branch with any capital letter, the controller will give an runtimeError while creating theGitBranchobject. This happens because we usebranch.Nameas part of the metedata.name of object, which is not allowed in kubenetes. You get error like: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