Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: make IMAGE_TAG available in buildArgs when used in docker FROM #9664

Open
wants to merge 33 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 17 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
1657f18
provide a docker.ImageReference in dependency resolution step
abe-winter Jun 19, 2024
147d21b
pass nils
abe-winter Jun 19, 2024
35a37c1
other plumbing
abe-winter Jun 19, 2024
f6411bf
fix: add back out io.Writer field
alphanota Jan 14, 2025
354b03c
Merge branch 'GoogleContainerTools:main' into abe-winter-changes
alphanota Jan 14, 2025
a61996c
fix bugs
alphanota Jan 14, 2025
13849cf
Merge branch 'GoogleContainerTools:main' into abe-winter-changes
alphanota Jan 15, 2025
d506f62
fix lookup and hash tests
alphanota Jan 15, 2025
c3bcf4d
fix tag test
alphanota Jan 15, 2025
67014b3
fix skaffold/runner
alphanota Jan 15, 2025
5076965
fix skaffold/graph
alphanota Jan 15, 2025
5324000
remove the tags field where its not needed
alphanota Jan 15, 2025
2784556
make fixes to test
alphanota Jan 16, 2025
630979a
fix tests
alphanota Jan 16, 2025
65af3c9
fix another typo
alphanota Jan 16, 2025
7e67078
add license boilerplate
alphanota Jan 16, 2025
ae699c0
add 2025 as a valid year
alphanota Jan 16, 2025
0b19012
chore:add integration test
alphanota Jan 16, 2025
da11b02
format go file
alphanota Jan 16, 2025
0787e5a
fix: lint and test
alphanota Jan 16, 2025
10ed9ec
fix test
alphanota Jan 16, 2025
104f908
fix:lint
alphanota Jan 16, 2025
0469ddd
add debug output
alphanota Jan 17, 2025
20c9e2a
add test action for debugging
alphanota Jan 17, 2025
6090a40
add test
alphanota Jan 17, 2025
a212113
add test
alphanota Jan 17, 2025
d52f744
add test
alphanota Jan 17, 2025
8f7960a
add test
alphanota Jan 17, 2025
a0569f3
add test
alphanota Jan 17, 2025
09b820a
use the default context when building the image
alphanota Jan 17, 2025
19cc68e
fix imports
alphanota Jan 17, 2025
6ea296a
fix: flaky helm deploy unit test by making the order of helm command …
alphanota Jan 17, 2025
fd7d94d
fix lint
alphanota Jan 18, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion hack/boilerplate/boilerplate.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def get_regexs():
# Search for "YEAR" which exists in the boilerplate, but shouldn't in the real thing
regexs["year"] = re.compile( 'YEAR' )
# dates can be 2018, company holder names can be anything
regexs["date"] = re.compile( '(2019|2020|2021|2022|2023|2024)' )
regexs["date"] = re.compile( '(2019|2020|2021|2022|2023|2024|2025)' )
# strip // +build \n\n build constraints
regexs["go_build_constraints"] = re.compile(r"^(// \+build.*\n)+\n", re.MULTILINE)
# strip //go:build \n build constraints (for go1.17 and higher)
Expand Down
6 changes: 3 additions & 3 deletions pkg/skaffold/build/cache/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ var (
)

type artifactHasher interface {
hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver) (string, error)
hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver, map[string]string) (string, error)
}

type artifactHasherImpl struct {
Expand All @@ -67,7 +67,7 @@ func newArtifactHasher(artifacts graph.ArtifactGraph, lister DependencyLister, m
}
}

func (h *artifactHasherImpl) hash(ctx context.Context, out io.Writer, a *latest.Artifact, platforms platform.Resolver) (string, error) {
func (h *artifactHasherImpl) hash(ctx context.Context, out io.Writer, a *latest.Artifact, platforms platform.Resolver, tags map[string]string) (string, error) {
ctx, endTrace := instrumentation.StartTrace(ctx, "hash_GenerateHashOneArtifact", map[string]string{
"ImageName": instrumentation.PII(a.ImageName),
})
Expand All @@ -80,7 +80,7 @@ func (h *artifactHasherImpl) hash(ctx context.Context, out io.Writer, a *latest.
}
hashes := []string{hash}
for _, dep := range sortedDependencies(a, h.artifacts) {
depHash, err := h.hash(ctx, out, dep, platforms)
depHash, err := h.hash(ctx, out, dep, platforms, tags)
Copy link
Collaborator

Choose a reason for hiding this comment

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

hash_test doesn't test this new behavior at all

if err != nil {
endTrace(instrumentation.TraceEndError(err))
return "", err
Expand Down
18 changes: 9 additions & 9 deletions pkg/skaffold/build/cache/hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ func TestGetHashForArtifact(t *testing.T) {
}

depLister := stubDependencyLister(test.dependencies)
actual, err := newArtifactHasher(nil, depLister, test.mode).hash(context.Background(), io.Discard, test.artifact, test.platforms)
actual, err := newArtifactHasher(nil, depLister, test.mode).hash(context.Background(), io.Discard, test.artifact, test.platforms, nil)

t.CheckNoError(err)
t.CheckDeepEqual(test.expected, actual)
Expand Down Expand Up @@ -246,7 +246,7 @@ func TestGetHashForArtifactWithDependencies(t *testing.T) {
return test.fileDeps[a.ImageName], nil
}

actual, err := newArtifactHasher(g, depLister, test.mode).hash(context.Background(), io.Discard, test.artifacts[0], platform.Resolver{})
actual, err := newArtifactHasher(g, depLister, test.mode).hash(context.Background(), io.Discard, test.artifacts[0], platform.Resolver{}, nil)

t.CheckNoError(err)
t.CheckDeepEqual(test.expected, actual)
Expand Down Expand Up @@ -309,21 +309,21 @@ func TestBuildArgs(t *testing.T) {
}
t.Override(&fileHasherFunc, mockCacheHasher)
t.Override(&artifactConfigFunc, fakeArtifactConfig)
actual, err := newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{})
actual, err := newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{}, nil)

t.CheckNoError(err)
t.CheckDeepEqual(test.expected, actual)

// Change order of buildargs
artifact.ArtifactType.DockerArtifact.BuildArgs = map[string]*string{"two": util.Ptr("2"), "one": util.Ptr("1")}
actual, err = newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{})
actual, err = newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{}, nil)

t.CheckNoError(err)
t.CheckDeepEqual(test.expected, actual)

// Change build args, get different hash
artifact.ArtifactType.DockerArtifact.BuildArgs = map[string]*string{"one": util.Ptr("1")}
actual, err = newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{})
actual, err = newArtifactHasher(nil, stubDependencyLister(nil), test.mode).hash(context.Background(), io.Discard, artifact, platform.Resolver{}, nil)

t.CheckNoError(err)
if actual == test.expected {
Expand Down Expand Up @@ -356,7 +356,7 @@ func TestBuildArgsEnvSubstitution(t *testing.T) {
t.Override(&artifactConfigFunc, fakeArtifactConfig)

depLister := stubDependencyLister([]string{"graph"})
hash1, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, artifact, platform.Resolver{})
hash1, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, artifact, platform.Resolver{}, nil)

t.CheckNoError(err)

Expand All @@ -366,7 +366,7 @@ func TestBuildArgsEnvSubstitution(t *testing.T) {
return []string{"FOO=baz"}
}

hash2, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, artifact, platform.Resolver{})
hash2, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, artifact, platform.Resolver{}, nil)

t.CheckNoError(err)
if hash1 == hash2 {
Expand Down Expand Up @@ -423,7 +423,7 @@ func TestCacheHasher(t *testing.T) {
path := originalFile
depLister := stubDependencyLister([]string{tmpDir.Path(originalFile)})

oldHash, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, &latest.Artifact{}, platform.Resolver{})
oldHash, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, &latest.Artifact{}, platform.Resolver{}, nil)
t.CheckNoError(err)

test.update(originalFile, tmpDir)
Expand All @@ -432,7 +432,7 @@ func TestCacheHasher(t *testing.T) {
}

depLister = stubDependencyLister([]string{tmpDir.Path(path)})
newHash, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, &latest.Artifact{}, platform.Resolver{})
newHash, err := newArtifactHasher(nil, depLister, config.RunModes.Build).hash(context.Background(), io.Discard, &latest.Artifact{}, platform.Resolver{}, nil)

t.CheckNoError(err)
t.CheckFalse(test.differentHash && oldHash == newHash)
Expand Down
7 changes: 4 additions & 3 deletions pkg/skaffold/build/cache/lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *cache) lookupArtifacts(ctx context.Context, out io.Writer, tags tag.Ima

i := i
go func() {
details[i] = c.lookup(ctx, out, artifacts[i], tags[artifacts[i].ImageName], platforms, h)
details[i] = c.lookup(ctx, out, artifacts[i], tags, platforms, h)
wg.Done()
}()
}
Expand All @@ -57,13 +57,14 @@ func (c *cache) lookupArtifacts(ctx context.Context, out io.Writer, tags tag.Ima
return details
}

func (c *cache) lookup(ctx context.Context, out io.Writer, a *latest.Artifact, tag string, platforms platform.Resolver, h artifactHasher) cacheDetails {
func (c *cache) lookup(ctx context.Context, out io.Writer, a *latest.Artifact, tags map[string]string, platforms platform.Resolver, h artifactHasher) cacheDetails {
tag := tags[a.ImageName]
ctx, endTrace := instrumentation.StartTrace(ctx, "lookup_CacheLookupOneArtifact", map[string]string{
"ImageName": instrumentation.PII(a.ImageName),
})
defer endTrace()

hash, err := h.hash(ctx, out, a, platforms)
hash, err := h.hash(ctx, out, a, platforms, tags)
if err != nil {
return failed{err: fmt.Errorf("getting hash for artifact %q: %s", a.ImageName, err)}
}
Expand Down
4 changes: 2 additions & 2 deletions pkg/skaffold/build/cache/lookup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -233,15 +233,15 @@ type mockHasher struct {
val string
}

func (m mockHasher) hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver) (string, error) {
func (m mockHasher) hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver, map[string]string) (string, error) {
return m.val, nil
}

type failingHasher struct {
err error
}

func (f failingHasher) hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver) (string, error) {
func (f failingHasher) hash(context.Context, io.Writer, *latest.Artifact, platform.Resolver, map[string]string) (string, error) {
return "", f.err
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/build/gcb/cloud_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ func (b *Builder) buildArtifactWithCloudBuild(ctx context.Context, out io.Writer
})
}

dependencies, err := b.sourceDependencies.SingleArtifactDependencies(ctx, artifact)
dependencies, err := b.sourceDependencies.SingleArtifactDependencies(ctx, artifact, nil)
if err != nil {
return "", sErrors.NewErrorWithStatusCode(&proto.ActionableErr{
ErrCode: proto.StatusCode_BUILD_GCB_GET_DEPENDENCY_ERR,
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/diagnose/diagnose.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func timeToListDependencies(ctx context.Context, a *latest.Artifact, cfg Config)
start := time.Now()
g := graph.ToArtifactGraph(cfg.Artifacts())
sourceDependencies := graph.NewSourceDependenciesCache(cfg, nil, g)
paths, err := sourceDependencies.SingleArtifactDependencies(ctx, a)
paths, err := sourceDependencies.SingleArtifactDependencies(ctx, a, nil)
return timeutil.Humanize(time.Since(start)), paths, err
}

Expand Down
1 change: 1 addition & 0 deletions pkg/skaffold/diagnose/diagnose_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ func TestCheckArtifacts(t *testing.T) {

err := CheckArtifacts(context.Background(), &mockConfig{
artifacts: []*latest.Artifact{{
ImageName: "base",
Workspace: tmpDir.Root(),
ArtifactType: latest.ArtifactType{
DockerArtifact: &latest.DockerArtifact{
Expand Down
13 changes: 2 additions & 11 deletions pkg/skaffold/docker/build_args_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,13 +226,13 @@ func TestCreateBuildArgsFromArtifacts(t *testing.T) {
}{
{
description: "can resolve artifacts",
r: mockArtifactResolver{m: map[string]string{"img1": "tag1", "img2": "tag2", "img3": "tag3", "img4": "tag4"}},
r: NewMockArtifactResolver(map[string]string{"img1": "tag1", "img2": "tag2", "img3": "tag3", "img4": "tag4"}),
deps: []*latest.ArtifactDependency{{ImageName: "img3", Alias: "alias3"}, {ImageName: "img4", Alias: "alias4"}},
args: map[string]*string{"alias3": util.Ptr("tag3"), "alias4": util.Ptr("tag4")},
},
{
description: "cannot resolve artifacts",
r: mockArtifactResolver{m: make(map[string]string)},
r: NewMockArtifactResolver(map[string]string{}),
args: map[string]*string{"alias3": nil, "alias4": nil},
deps: []*latest.ArtifactDependency{{ImageName: "img3", Alias: "alias3"}, {ImageName: "img4", Alias: "alias4"}},
},
Expand Down Expand Up @@ -281,12 +281,3 @@ func TestBuildArgTemplating(t *testing.T) {
t.CheckMatches(*filledMap["SO_SECRET"], "do not say it")
})
}

type mockArtifactResolver struct {
m map[string]string
}

func (r mockArtifactResolver) GetImageTag(imageName string) (string, bool) {
val, found := r.m[imageName]
return val, found
}
46 changes: 46 additions & 0 deletions pkg/skaffold/docker/dockertest.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
Copyright 2025 The Skaffold Authors

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/

package docker

// MockArtifactResolver mocks docker.ArtifactResolver interface.
type mockArtifactResolver struct {
m map[string]string
}

// NewMockArtifactResolver returns a mock ArtifactResolver for testing.
func NewMockArtifactResolver(m map[string]string) *mockArtifactResolver {
return &mockArtifactResolver{m}
}

func (r mockArtifactResolver) GetImageTag(imageName string) (string, bool) {
val, found := r.m[imageName]
return val, found
}

// simpleMockArtifactResolver is an implementation of docker.ArtifactResolver
// that returns the same value for any key
type simpleMockArtifactResolver struct{}
Copy link
Collaborator

Choose a reason for hiding this comment

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

I would probably call this stubArtifactResolver. Googling "stub vs mock" leads to 100s of pages with a variety of explanations, but here's a somewhat reasonable one:

A stub provides predetermined responses to calls made during a test. ... These responses are usually based on hard coded values or objects pre-programmed to return specific outputs, making them predictable.


// GetImageTag is an implementation of docker.ArtifactResolver that
// always returns the same tag.
func (s *simpleMockArtifactResolver) GetImageTag(_ string) (string, bool) {
return "image:latest", true
}

func NewSimpleMockArtifactResolver() ArtifactResolver {
return &simpleMockArtifactResolver{}
}
34 changes: 28 additions & 6 deletions pkg/skaffold/graph/dependencies.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type SourceDependenciesCache interface {
TransitiveArtifactDependencies(ctx context.Context, a *latest.Artifact) ([]string, error)
// SingleArtifactDependencies returns the source dependencies for only the target artifact.
// The result (even if an error) is cached so that the function is evaluated only once for every artifact. The cache is reset before the start of the next devloop.
SingleArtifactDependencies(ctx context.Context, a *latest.Artifact) ([]string, error)
SingleArtifactDependencies(ctx context.Context, a *latest.Artifact, envTags map[string]string) ([]string, error)
// Reset removes the cached source dependencies for all artifacts
Reset()
}
Expand All @@ -65,7 +65,15 @@ func (r *dependencyResolverImpl) TransitiveArtifactDependencies(ctx context.Cont
})
defer endTrace()

deps, err := r.SingleArtifactDependencies(ctx, a)
tag, ok := r.artifactResolver.GetImageTag(a.ImageName)
if !ok {
return nil, fmt.Errorf("unable to resolve tag for image: %s", a.ImageName)
}
envTags, err := EnvTags(tag)
if err != nil {
return nil, fmt.Errorf("unable to parse build args from tag %s: err %w", tag, err)
}
deps, err := r.SingleArtifactDependencies(ctx, a, envTags)
Comment on lines +68 to +76
Copy link
Collaborator

Choose a reason for hiding this comment

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

there are no unit tests for this new behavior

if err != nil {
endTrace(instrumentation.TraceEndError(err))
return nil, err
Expand All @@ -81,14 +89,14 @@ func (r *dependencyResolverImpl) TransitiveArtifactDependencies(ctx context.Cont
return deps, nil
}

func (r *dependencyResolverImpl) SingleArtifactDependencies(ctx context.Context, a *latest.Artifact) ([]string, error) {
func (r *dependencyResolverImpl) SingleArtifactDependencies(ctx context.Context, a *latest.Artifact, envTags map[string]string) ([]string, error) {
ctx, endTrace := instrumentation.StartTrace(ctx, "SingleArtifactDependencies", map[string]string{
"ArtifactName": instrumentation.PII(a.ImageName),
})
defer endTrace()

res, err := r.cache.Exec(a.ImageName, func() ([]string, error) {
return getDependenciesFunc(ctx, a, r.cfg, r.artifactResolver)
return getDependenciesFunc(ctx, a, r.cfg, r.artifactResolver, envTags)
})
if err != nil {
endTrace(instrumentation.TraceEndError(err))
Expand All @@ -104,8 +112,21 @@ func (r *dependencyResolverImpl) Reset() {
r.cache = util.NewSyncStore[[]string]()
}

// EnvTags generate a set of build tags from the docker image name.
func EnvTags(tag string) (map[string]string, error) {
imgRef, err := docker.ParseReference(tag)
if err != nil {
return nil, fmt.Errorf("couldn't parse image tag %s %w", tag, err)
}
return map[string]string{
"IMAGE_REPO": imgRef.Repo,
"IMAGE_NAME": imgRef.Name,
"IMAGE_TAG": imgRef.Tag,
}, nil
}

// sourceDependenciesForArtifact returns the build dependencies for the current artifact.
func sourceDependenciesForArtifact(ctx context.Context, a *latest.Artifact, cfg docker.Config, r docker.ArtifactResolver) ([]string, error) {
func sourceDependenciesForArtifact(ctx context.Context, a *latest.Artifact, cfg docker.Config, r docker.ArtifactResolver, envTags map[string]string) ([]string, error) {
var (
paths []string
err error
Expand All @@ -118,7 +139,8 @@ func sourceDependenciesForArtifact(ctx context.Context, a *latest.Artifact, cfg
// For single build scenarios like `build` and `run`, it is called for the cache hash calculations which are already handled in `artifactHasher`.
// For `dev` it will succeed on the first dev loop and list any additional dependencies found from the base artifact's ONBUILD instructions as a file added instead of modified (see `filemon.Events`)
deps := docker.ResolveDependencyImages(a.Dependencies, r, false)
args, evalErr := docker.EvalBuildArgs(cfg.Mode(), a.Workspace, a.DockerArtifact.DockerfilePath, a.DockerArtifact.BuildArgs, deps)

args, evalErr := docker.EvalBuildArgsWithEnv(cfg.Mode(), a.Workspace, a.DockerArtifact.DockerfilePath, a.DockerArtifact.BuildArgs, deps, envTags)
if evalErr != nil {
return nil, fmt.Errorf("unable to evaluate build args: %w", evalErr)
}
Expand Down
15 changes: 7 additions & 8 deletions pkg/skaffold/graph/dependencies_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ func TestSourceDependenciesCache(t *testing.T) {
"img4": {"file41", "file42"},
}
counts := map[string]int{"img1": 0, "img2": 0, "img3": 0, "img4": 0}
t.Override(&getDependenciesFunc, func(_ context.Context, a *latest.Artifact, _ docker.Config, _ docker.ArtifactResolver) ([]string, error) {
t.Override(&getDependenciesFunc, func(_ context.Context, a *latest.Artifact, _ docker.Config, _ docker.ArtifactResolver, _ map[string]string) ([]string, error) {
counts[a.ImageName]++
return deps[a.ImageName], nil
})

r := NewSourceDependenciesCache(nil, nil, g)
r := NewSourceDependenciesCache(nil, docker.NewSimpleMockArtifactResolver(), g)
d, err := r.TransitiveArtifactDependencies(context.Background(), g["img1"])
t.CheckNoError(err)
expectedDeps := []string{"file11", "file12", "file21", "file22", "file31", "file32", "file41", "file42", "file41", "file42"}
Expand All @@ -67,11 +67,10 @@ func TestSourceDependenciesForArtifact(t *testing.T) {
"dir2/frob.go",
)
tests := []struct {
description string
artifact *latest.Artifact
dockerConfig docker.Config
dockerArtifactResolver docker.ArtifactResolver
expectedPaths []string
description string
artifact *latest.Artifact
dockerConfig docker.Config
expectedPaths []string
}{
{
description: "ko default dependencies",
Expand All @@ -89,7 +88,7 @@ func TestSourceDependenciesForArtifact(t *testing.T) {
}
for _, test := range tests {
testutil.Run(t, test.description, func(t *testutil.T) {
paths, err := sourceDependenciesForArtifact(context.Background(), test.artifact, test.dockerConfig, test.dockerArtifactResolver)
paths, err := sourceDependenciesForArtifact(context.Background(), test.artifact, test.dockerConfig, nil, nil)
t.CheckNoError(err)
t.CheckDeepEqual(test.expectedPaths, paths,
cmpopts.SortSlices(func(x, y string) bool { return x < y }))
Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/runner/listen_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ func (f *fakeDepsResolver) TransitiveArtifactDependencies(context.Context, *late
return nil, nil
}

func (f *fakeDepsResolver) SingleArtifactDependencies(context.Context, *latest.Artifact) ([]string, error) {
func (f *fakeDepsResolver) SingleArtifactDependencies(context.Context, *latest.Artifact, map[string]string) ([]string, error) {
return nil, nil
}

Expand Down
2 changes: 1 addition & 1 deletion pkg/skaffold/runner/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ func NewForConfig(ctx context.Context, runCtx *runcontext.RunContext) (*Skaffold
ctx, endTrace := instrumentation.StartTrace(ctx, "NewForConfig_depLister")
defer endTrace()

buildDependencies, err := sourceDependencies.SingleArtifactDependencies(ctx, artifact)
buildDependencies, err := sourceDependencies.SingleArtifactDependencies(ctx, artifact, nil)
if err != nil {
endTrace(instrumentation.TraceEndError(err))
return nil, err
Expand Down
Loading
Loading