Skip to content

Convert git tag into proper docker tag#3407

Merged
dgageot merged 2 commits intoGoogleContainerTools:masterfrom
dgageot:fix-3344
Dec 20, 2019
Merged

Convert git tag into proper docker tag#3407
dgageot merged 2 commits intoGoogleContainerTools:masterfrom
dgageot:fix-3344

Conversation

@dgageot
Copy link
Copy Markdown
Contributor

@dgageot dgageot commented Dec 19, 2019

Fixes #3344

@codecov
Copy link
Copy Markdown

codecov bot commented Dec 19, 2019

Codecov Report

Merging #3407 into master will increase coverage by 0.13%.
The diff coverage is 100%.

Impacted Files Coverage Δ
pkg/skaffold/build/tag/git_commit.go 83.11% <100%> (+13.99%) ⬆️
pkg/skaffold/util/tar.go 57.47% <0%> (+4.59%) ⬆️

return fmt.Sprintf("%s:%s", imageName, ref), nil
}

func gitTagToDockerTag(text string) string {
Copy link
Copy Markdown
Contributor

@balopat balopat Dec 19, 2019

Choose a reason for hiding this comment

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

Nit: I don't think there is anything got specific about this - and it doesn't say what it does: escapeAndTruncateAsTag?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Or sanitizeTag could be another option

if len(withAuthorizedPrefix) > 128 {
return withAuthorizedPrefix[0:128]
}

Copy link
Copy Markdown
Contributor

@balopat balopat Dec 19, 2019

Choose a reason for hiding this comment

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

I would also add a warning or maybe debug message for visibility when we do change the tag - when tags start to overlap accidentally,this can be a useful hint

Copy link
Copy Markdown
Contributor

@balopat balopat left a comment

Choose a reason for hiding this comment

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

LGTM with small nits

Signed-off-by: David Gageot <david@gageot.net>
Signed-off-by: David Gageot <david@gageot.net>
@dgageot
Copy link
Copy Markdown
Contributor Author

dgageot commented Dec 20, 2019

Fixed all the nits

@dgageot dgageot merged commit 0c87e4c into GoogleContainerTools:master Dec 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

git tag contains "/" causes docker build failure

3 participants