mirror of
https://github.com/GoogleContainerTools/kaniko
synced 2026-10-18 03:08:27 +02:00
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:
co-authored by
Tejal Desai
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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user