From 8877ed9b3588e0c16fee32443a6888f6a9914752 Mon Sep 17 00:00:00 2001 From: Josh Chorlton Date: Sat, 26 Dec 2020 06:37:52 +0000 Subject: [PATCH 1/2] reject tarball writes with no destinations --- pkg/executor/push.go | 5 +++++ pkg/snapshot/snapshot.go | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/pkg/executor/push.go b/pkg/executor/push.go index 4793765c41..9fe0274f8f 100644 --- a/pkg/executor/push.go +++ b/pkg/executor/push.go @@ -217,6 +217,11 @@ func DoPush(image v1.Image, opts *config.KanikoOptions) error { if opts.TarPath != "" { tagToImage := map[name.Tag]v1.Image{} + + if len(destRefs) == 0 { + return errors.New("must provide at least one destination when tarPath is specified") + } + for _, destRef := range destRefs { tagToImage[destRef] = image } diff --git a/pkg/snapshot/snapshot.go b/pkg/snapshot/snapshot.go index 81c8371f39..9423701f46 100644 --- a/pkg/snapshot/snapshot.go +++ b/pkg/snapshot/snapshot.go @@ -169,7 +169,7 @@ func (s *Snapshotter) scanFullFilesystem() ([]string, []string, error) { } for _, path := range resolvedFiles { if util.CheckIgnoreList(path) { - logrus.Tracef("Not adding %s to layer, as it's whitelisted", path) + logrus.Tracef("Not adding %s to layer, as it's allowlisted", path) continue } filesToAdd = append(filesToAdd, path) From 18f40500691daf19ce48880528fe704d5498e3df Mon Sep 17 00:00:00 2001 From: Tejal Desai Date: Sun, 3 Jan 2021 10:12:54 -0800 Subject: [PATCH 2/2] Update pkg/snapshot/snapshot.go --- pkg/snapshot/snapshot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/snapshot/snapshot.go b/pkg/snapshot/snapshot.go index 9423701f46..ed4888ed70 100644 --- a/pkg/snapshot/snapshot.go +++ b/pkg/snapshot/snapshot.go @@ -169,7 +169,7 @@ func (s *Snapshotter) scanFullFilesystem() ([]string, []string, error) { } for _, path := range resolvedFiles { if util.CheckIgnoreList(path) { - logrus.Tracef("Not adding %s to layer, as it's allowlisted", path) + logrus.Tracef("Not adding %s to layer, as it's ignored", path) continue } filesToAdd = append(filesToAdd, path)