mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-21 19:01:49 +00:00
Merge pull request #101287 from soltysh/replace_with_default
Fail fast when image is specified without tag
This commit is contained in:
commit
6a7572e4ad
@ -73,7 +73,7 @@ spec:
|
|||||||
# test for directories or create them. It needs additional privileges
|
# test for directories or create them. It needs additional privileges
|
||||||
# for that.
|
# for that.
|
||||||
- name: busybox
|
- name: busybox
|
||||||
image: k8s.gcr.io/busybox
|
image: k8s.gcr.io/e2e-test-images/busybox:1.29-1
|
||||||
securityContext:
|
securityContext:
|
||||||
privileged: true
|
privileged: true
|
||||||
command:
|
command:
|
||||||
|
@ -373,6 +373,9 @@ func ReplaceRegistryInImageURL(imageURL string) (string, error) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
last := strings.SplitN(parts[countParts-1], ":", 2)
|
last := strings.SplitN(parts[countParts-1], ":", 2)
|
||||||
|
if len(last) == 1 {
|
||||||
|
return "", fmt.Errorf("image %q is required to be in an image:tag format", imageURL)
|
||||||
|
}
|
||||||
config := getRepositoryMappedConfig(index, Config{
|
config := getRepositoryMappedConfig(index, Config{
|
||||||
registry: parts[0],
|
registry: parts[0],
|
||||||
name: strings.Join([]string{strings.Join(parts[1:countParts-1], "/"), last[0]}, "/"),
|
name: strings.Join([]string{strings.Join(parts[1:countParts-1], "/"), last[0]}, "/"),
|
||||||
@ -384,6 +387,8 @@ func ReplaceRegistryInImageURL(imageURL string) (string, error) {
|
|||||||
switch registryAndUser {
|
switch registryAndUser {
|
||||||
case "gcr.io/kubernetes-e2e-test-images":
|
case "gcr.io/kubernetes-e2e-test-images":
|
||||||
registryAndUser = e2eRegistry
|
registryAndUser = e2eRegistry
|
||||||
|
case "k8s.gcr.io/e2e-test-images":
|
||||||
|
registryAndUser = promoterE2eRegistry
|
||||||
case "k8s.gcr.io":
|
case "k8s.gcr.io":
|
||||||
registryAndUser = gcRegistry
|
registryAndUser = gcRegistry
|
||||||
case "k8s.gcr.io/sig-storage":
|
case "k8s.gcr.io/sig-storage":
|
||||||
|
Loading…
Reference in New Issue
Block a user