Fix containerRegistry for Kubernetes < 1.10

This commit is contained in:
Christian Kampka 2018-06-20 09:44:11 +02:00
parent 9a4c553fde
commit 921591343a
1 changed files with 5 additions and 1 deletions

View File

@ -151,7 +151,11 @@ func (a *AssetBuilder) RemapImage(image string) (string, error) {
normalized := image
// Remove the 'standard' kubernetes image prefix, just for sanity
normalized = strings.TrimPrefix(normalized, "k8s.gcr.io/")
if !util.IsKubernetesGTE("1.10", a.KubernetesVersion) && strings.HasPrefix(normalized, "gcr.io/google_containers/") {
normalized = strings.TrimPrefix(normalized, "gcr.io/google_containers/")
} else {
normalized = strings.TrimPrefix(normalized, "k8s.gcr.io/")
}
// We can't nest arbitrarily
// Some risk of collisions, but also -- and __ in the names appear to be blocked by docker hub