reject tarball writes with no destinations (#1534)
* reject tarball writes with no destinations * Update pkg/snapshot/snapshot.go Co-authored-by: Tejal Desai <tejal29@gmail.com>
This commit is contained in:
parent
397912d96c
commit
ece215c181
|
|
@ -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
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue