From 3ab6524fe580464e98817a3a59505f10b82baf23 Mon Sep 17 00:00:00 2001 From: Dani Raznikov Date: Fri, 3 Apr 2020 17:39:59 +0300 Subject: [PATCH] optimize: don't parse Dockerfile twice and just reuse stages --- pkg/executor/build.go | 2 -- pkg/executor/build_test.go | 1 - 2 files changed, 3 deletions(-) diff --git a/pkg/executor/build.go b/pkg/executor/build.go index 8db06a0c9d..5479658989 100644 --- a/pkg/executor/build.go +++ b/pkg/executor/build.go @@ -556,7 +556,6 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) { return nil, err } - // TODO is this even used? if err := util.GetExcludedFiles(opts.DockerfilePath, opts.SrcContext); err != nil { return nil, err } @@ -565,7 +564,6 @@ func DoBuild(opts *config.KanikoOptions) (v1.Image, error) { if err := fetchExtraStages(stages, opts); err != nil { return nil, err } - crossStageDependencies, err := CalculateDependencies(stages, opts) if err != nil { return nil, err diff --git a/pkg/executor/build_test.go b/pkg/executor/build_test.go index 121d01bd71..344e2611b0 100644 --- a/pkg/executor/build_test.go +++ b/pkg/executor/build_test.go @@ -326,7 +326,6 @@ COPY --from=stage2 /bar /bat if err != nil { t.Errorf("Failed to parse test dockerfile to stages: %s", err) } - got, err := CalculateDependencies(testStages, opts) if err != nil { t.Errorf("got error: %s,", err)