Skip to content

Commit ed63b09

Browse files
authored
[deckhouse-cli] fix tag resolving (#223)
Signed-off-by: Pavel Okhlopkov <[email protected]>
1 parent ce94200 commit ed63b09

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

pkg/libmirror/layouts/pull.go

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ func PullImageSet(
206206

207207
pullCount, totalCount := 1, len(imageSet)
208208
for imageReferenceString := range imageSet {
209-
imageRepo, _ := splitImageRefByRepoAndTag(imageReferenceString)
209+
imageRepo, originalTag := splitImageRefByRepoAndTag(imageReferenceString)
210210

211211
// If we already know the digest of the tagged image, we should pull it by this digest instead of pulling by tag
212212
// to avoid race-conditions between mirroring and releasing new builds on release channels.
@@ -224,6 +224,8 @@ func PullImageSet(
224224

225225
logger.Debugf("reference here: %s", ref.String())
226226

227+
// tag here can be ussually tag or digest
228+
// thats why we need original tag calculated upper
227229
imagePath, tag := splitImageRefByRepoAndTag(pullReference)
228230

229231
scopedClient := client
@@ -256,7 +258,8 @@ func PullImageSet(
256258
layout.WithPlatform(v1.Platform{Architecture: "amd64", OS: "linux"}),
257259
layout.WithAnnotations(map[string]string{
258260
"org.opencontainers.image.ref.name": imageReferenceString,
259-
"io.deckhouse.image.short_tag": tag,
261+
// original tag here to have tagged releases as an alias
262+
"io.deckhouse.image.short_tag": originalTag,
260263
}),
261264
)
262265
if err != nil {

0 commit comments

Comments
 (0)