Skip to content

Commit ab16982

Browse files
lookup image id with tag rather than name
fixes #5162
1 parent e9c9bdb commit ab16982

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

pkg/skaffold/build/cache/lookup.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ func (c *cache) lookup(ctx context.Context, a *latest.Artifact, tag string, h ar
5959
entry, cacheHit := c.artifactCache[hash]
6060
c.cacheMutex.RUnlock()
6161
if !cacheHit {
62-
if entry, err = c.tryImport(ctx, a, tag, hash); err != nil {
62+
if entry, err = c.tryImport(ctx, tag, hash); err != nil {
6363
logrus.Debugf("Could not import artifact from Docker, building instead (%s)", err)
6464
return needsBuilding{hash: hash}
6565
}
@@ -120,7 +120,7 @@ func (c *cache) lookupRemote(ctx context.Context, hash, tag string, entry ImageD
120120
return needsBuilding{hash: hash}
121121
}
122122

123-
func (c *cache) tryImport(ctx context.Context, a *latest.Artifact, tag string, hash string) (ImageDetails, error) {
123+
func (c *cache) tryImport(ctx context.Context, tag string, hash string) (ImageDetails, error) {
124124
if !c.tryImportMissing {
125125
return ImageDetails{}, fmt.Errorf("import of missing images disabled")
126126
}
@@ -137,7 +137,7 @@ func (c *cache) tryImport(ctx context.Context, a *latest.Artifact, tag string, h
137137
logrus.Debugf("Importing artifact %s from local docker", tag)
138138
}
139139

140-
imageID, err := c.client.ImageID(ctx, a.ImageName)
140+
imageID, err := c.client.ImageID(ctx, tag)
141141
if err != nil {
142142
return entry, err
143143
}

0 commit comments

Comments
 (0)