Skip to content

[1340] Disable git labels if BUILDX_GIT_LABELS is not 1 or full - #1341

Merged
crazy-max merged 1 commit into
docker:masterfrom
dgageot:fix-1340
Oct 4, 2022
Merged

crazy-max merged 1 commit into
docker:masterfrom
dgageot:fix-1340

Conversation

@dgageot

@dgageot dgageot commented Oct 3, 2022 •

Copy link
Copy Markdown
Member

This is to make sure that BUILDX_GIT_LABELS= docker buildx build ... will not set the git labels.

Fixes #1340

Signed-off-by: David Gageot [email protected]

@crazy-max crazy-max left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM thanks, PTAL @cdupuis

@cdupuis

cdupuis commented Oct 4, 2022

Copy link
Copy Markdown
Contributor

LGTM. Thanks for the improvement.

@crazy-max
crazy-max merged commit 3a5741f into docker:master Oct 4, 2022
Comment thread build/git.go
v, ok := os.LookupEnv("BUILDX_GIT_LABELS")
if !ok || contextPath == "" {
v := os.Getenv("BUILDX_GIT_LABELS")
if (v != "1" && v != "full") || contextPath == "" {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Could we just do strconv.ParseBool in here like we do in some other places?

@cdupuis Do you need this string "full" for something?

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.

Setting the env var to full will include the repository url. We did this so that there's a way to not leak repository names but still include commit sha.

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.

BUILDX_GIT_LABELS= or BUILDX_GIT_LABELS=0 don't deactivate git labels

4 participants