diff --git a/pkg/executor/build_test.go b/pkg/executor/build_test.go index db3f55154..64046bc29 100644 --- a/pkg/executor/build_test.go +++ b/pkg/executor/build_test.go @@ -538,7 +538,7 @@ func Test_stageBuilder_build(t *testing.T) { filePath := filepath.Join(dir, file) ch := NewCompositeCache("", "meow") - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash, err := ch.Hash() if err != nil { t.Errorf("couldn't create hash %v", err) @@ -570,7 +570,7 @@ func Test_stageBuilder_build(t *testing.T) { filePath := filepath.Join(dir, file) ch := NewCompositeCache("", "meow") - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash, err := ch.Hash() if err != nil { t.Errorf("couldn't create hash %v", err) @@ -618,7 +618,7 @@ func Test_stageBuilder_build(t *testing.T) { tarContent := generateTar(t, dir, filename) ch := NewCompositeCache("", "") - ch.AddPath(filepath) + ch.AddPath(filepath, "") hash, err := ch.Hash() if err != nil { @@ -662,7 +662,7 @@ func Test_stageBuilder_build(t *testing.T) { } filePath := filepath.Join(dir, filename) ch := NewCompositeCache("", "") - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash, err := ch.Hash() if err != nil { @@ -713,7 +713,7 @@ func Test_stageBuilder_build(t *testing.T) { } ch.AddKey(fmt.Sprintf("COPY %s bar.txt", filename)) - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash2, err := ch.Hash() if err != nil { @@ -721,7 +721,7 @@ func Test_stageBuilder_build(t *testing.T) { } ch = NewCompositeCache("", fmt.Sprintf("COPY %s foo.txt", filename)) ch.AddKey(fmt.Sprintf("COPY %s bar.txt", filename)) - ch.AddPath(filePath) + ch.AddPath(filePath, "") image := fakeImage{ ImageLayers: []v1.Layer{ @@ -777,14 +777,14 @@ COPY %s bar.txt } filePath := filepath.Join(dir, filename) ch := NewCompositeCache("", fmt.Sprintf("COPY %s foo.txt", filename)) - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash1, err := ch.Hash() if err != nil { t.Errorf("couldn't create hash %v", err) } ch.AddKey(fmt.Sprintf("COPY %s bar.txt", filename)) - ch.AddPath(filePath) + ch.AddPath(filePath, "") hash2, err := ch.Hash() if err != nil { @@ -792,7 +792,7 @@ COPY %s bar.txt } ch = NewCompositeCache("", fmt.Sprintf("COPY %s foo.txt", filename)) ch.AddKey(fmt.Sprintf("COPY %s bar.txt", filename)) - ch.AddPath(filePath) + ch.AddPath(filePath, "") image := fakeImage{ ImageLayers: []v1.Layer{ diff --git a/pkg/executor/composite_cache_test.go b/pkg/executor/composite_cache_test.go index 095c3ae64..764364e93 100644 --- a/pkg/executor/composite_cache_test.go +++ b/pkg/executor/composite_cache_test.go @@ -80,7 +80,7 @@ func Test_CompositeCache_AddPath_dir(t *testing.T) { fn := func() string { r := NewCompositeCache() - if err := r.AddPath(tmpDir); err != nil { + if err := r.AddPath(tmpDir, ""); err != nil { t.Errorf("expected error to be nil but was %v", err) } @@ -118,7 +118,7 @@ func Test_CompositeCache_AddPath_file(t *testing.T) { p := tmpfile.Name() fn := func() string { r := NewCompositeCache() - if err := r.AddPath(p); err != nil { + if err := r.AddPath(p, ""); err != nil { t.Errorf("expected error to be nil but was %v", err) }