Skip to content

Commit

Permalink
fix for #7024
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruslan Karimov committed Feb 16, 2022
1 parent 35ec779 commit 76edb18
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pkg/skaffold/docker/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,10 @@ func (l *localDaemon) TagWithImageID(ctx context.Context, ref string, imageID st
return "", err
}

if imageID == "" {
log.Entry(ctx).Debugf("generating tag for %s: empty image id\n", ref)
return "", nil
}
uniqueTag := parsed.BaseName + ":" + strings.TrimPrefix(imageID, "sha256:")
if err := l.Tag(ctx, imageID, uniqueTag); err != nil {
return "", err
Expand Down
4 changes: 4 additions & 0 deletions pkg/skaffold/docker/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,10 @@ func TestTagWithImageID(t *testing.T) {
imageName: "!!invalid!!",
shouldErr: true,
},
{
description: "empty image id",
imageName: "ref",
},
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
Expand Down

0 comments on commit 76edb18

Please sign in to comment.