Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convert git tag into proper docker tag #3407

Merged
merged 2 commits into from
Dec 20, 2019

Conversation

dgageot
Copy link
Contributor

@dgageot dgageot commented Dec 19, 2019

Fixes #3344

@codecov
Copy link

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
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
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
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
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
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