Skip to content

WIP: Better handling of invalid tag names#250

Draft
StevenMaude wants to merge 1 commit intomainfrom
steve/failures-on-tag-name-issue-2580
Draft

WIP: Better handling of invalid tag names#250
StevenMaude wants to merge 1 commit intomainfrom
steve/failures-on-tag-name-issue-2580

Conversation

@StevenMaude
Copy link
Contributor

@StevenMaude StevenMaude commented Jan 5, 2026

For some reason, in some rare cases, the tag name ends up as being the specific branch name, rather than the target. Not sure why. These extra checks are a workaround for invalid names making it to Docker.

For some reason, in some rare cases, the tag name ends up as being the
branch name, rather than QA. Not sure why. These extra checks are a
workaround for invalid names making it to Docker.
// 1. Valid chars: a-z, A-Z, 0-9, dot (.), underscore (_), minus (-).
// 2. Max length: 128 characters.
// 3. Cannot start with a dot (.) or minus (-).
func CleanDockerTag(input string) string {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may not be the correct place for this.

types.ImageBuildOptions{
Remove: true,
Tags: []string{name},
Tags: []string{CleanDockerTag(name)},
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could do without having to clean the name twice.

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

Successfully merging this pull request may close these issues.

1 participant