mirror of
https://gitea.com/Lydanne/buildx.git
synced 2025-07-10 05:27:07 +08:00
Support empty env var when it can't be unset
Signed-off-by: David Gageot <david.gageot@docker.com>
This commit is contained in:
@ -64,6 +64,14 @@ func TestAddGitProvenanceDataWithoutEnv(t *testing.T) {
|
||||
assert.Nilf(t, labels, "No labels expected")
|
||||
}
|
||||
|
||||
func TestAddGitProvenanceDataWitEmptyEnv(t *testing.T) {
|
||||
defer setupTest(t)(t)
|
||||
os.Setenv("BUILDX_GIT_LABELS", "")
|
||||
labels, err := addGitProvenance(context.Background(), repoDir, filepath.Join(repoDir, "Dockerfile"))
|
||||
assert.Nilf(t, err, "No error expected")
|
||||
assert.Nilf(t, labels, "No labels expected")
|
||||
}
|
||||
|
||||
func TestAddGitProvenanceDataWithoutLabels(t *testing.T) {
|
||||
defer setupTest(t)(t)
|
||||
os.Setenv("BUILDX_GIT_LABELS", "full")
|
||||
|
Reference in New Issue
Block a user