Skip to content

Commit

Permalink
Changing test config invalidates the build cache
Browse files Browse the repository at this point in the history
Fixes #3982

Signed-off-by: David Gageot <[email protected]>
  • Loading branch information
dgageot committed Apr 21, 2020
1 parent 992ced4 commit 7420e4e
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions pkg/skaffold/runner/new.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,33 @@ func NewForConfig(runCtx *runcontext.RunContext) (*SkaffoldRunner, error) {
return nil, fmt.Errorf("parsing build config: %w", err)
}

tester := getTester(runCtx)
syncer := getSyncer(runCtx)

imagesAreLocal := false
if localBuilder, ok := builder.(*local.Builder); ok {
imagesAreLocal = !localBuilder.PushImages()
}

depLister := func(ctx context.Context, artifact *latest.Artifact) ([]string, error) {
return build.DependenciesForArtifact(ctx, artifact, runCtx.InsecureRegistries)
buildDependencies, err := build.DependenciesForArtifact(ctx, artifact, runCtx.InsecureRegistries)
if err != nil {
return nil, err
}

testDependencies, err := tester.TestDependencies()
if err != nil {
return nil, err
}

return append(buildDependencies, testDependencies...), nil
}

artifactCache, err := cache.NewCache(runCtx, imagesAreLocal, depLister)
if err != nil {
return nil, fmt.Errorf("initializing cache: %w", err)
}

tester := getTester(runCtx)
syncer := getSyncer(runCtx)

deployer, err := getDeployer(runCtx)
if err != nil {
return nil, fmt.Errorf("parsing deploy config: %w", err)
Expand Down

0 comments on commit 7420e4e

Please sign in to comment.