image: prepend library/ when using registry

Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
Yoan Blanc 2020-05-12 14:46:25 +02:00
parent cb11a9982c
commit fef4bb55b7
No known key found for this signature in database
GPG Key ID: 6058CF4574298812
1 changed files with 8 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import (
"net/http"
"path/filepath"
"strconv"
"strings"
"github.com/GoogleContainerTools/kaniko/pkg/timing"
@ -118,6 +119,13 @@ func remoteImage(image string, opts *config.KanikoOptions) (v1.Image, error) {
return nil, err
}
if !strings.ContainsRune(image, '/') {
ref, err = name.ParseReference("library/"+image, name.WeakValidation)
if err != nil {
return nil, err
}
}
toSet = true
}