Skip to content

bake: hasGitAuthTokenSecret func#550

Merged
crazy-max merged 1 commit into
docker:mainfrom
crazy-max:bake-check-git-auth-token
Jan 10, 2025
Merged

bake: hasGitAuthTokenSecret func#550
crazy-max merged 1 commit into
docker:mainfrom
crazy-max:bake-check-git-auth-token

Conversation

@crazy-max

@crazy-max crazy-max commented Jan 10, 2025

Copy link
Copy Markdown
Member

Similar to what we have with build:

public static hasGitAuthTokenSecret(secrets: string[]): boolean {
for (const secret of secrets) {
if (secret.startsWith('GIT_AUTH_TOKEN=')) {
return true;
}
}
return false;
}

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max marked this pull request as ready for review January 10, 2025 08:19
Comment thread src/buildx/bake.ts
secretEntry.src = value;
break;
case 'env':
secretEntry.env = value;

@crazy-max crazy-max Jan 10, 2025

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This change is an oversight and fixes an issue when parsing secrets to be aligned with buildx logic: https://github.com/docker/buildx/blob/16edf5d4aa76ef9978c06889d66249aeab5729fe/util/buildflags/secrets.go#L106

Also add tests to make sure we cover everything.

@crazy-max crazy-max merged commit b754abc into docker:main Jan 10, 2025
@crazy-max crazy-max deleted the bake-check-git-auth-token branch January 10, 2025 08:34
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