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

Runtime error when reconciling branches that contain capital letters #28

@Kaitou786

Description

@Kaitou786

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions