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

reject tarball writes with no destinations #1534

Merged
merged 2 commits into from
Jan 3, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions pkg/executor/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/snapshot/snapshot.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 ignored", path)
continue
}
filesToAdd = append(filesToAdd, path)
Expand Down