mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-20 10:20:51 +00:00
Merge pull request #110465 from bertinatto/e2e-populator-fix
e2e: ensure single image for populator containers
This commit is contained in:
commit
61a0ee5588
@ -301,20 +301,27 @@ func (p *provisioningTestSuite) DefineTests(driver storageframework.TestDriver,
|
||||
for i, container := range item.Spec.Template.Spec.Containers {
|
||||
switch container.Name {
|
||||
case "hello":
|
||||
var found bool
|
||||
args := []string{}
|
||||
var foundNS, foundImage bool
|
||||
for _, arg := range container.Args {
|
||||
if strings.HasPrefix(arg, "--namespace=") {
|
||||
args = append(args, fmt.Sprintf("--namespace=%s", popNamespace.Name))
|
||||
found = true
|
||||
foundNS = true
|
||||
} else if strings.HasPrefix(arg, "--image-name=") {
|
||||
args = append(args, fmt.Sprintf("--image-name=%s", container.Image))
|
||||
foundImage = true
|
||||
} else {
|
||||
args = append(args, arg)
|
||||
}
|
||||
}
|
||||
if !found {
|
||||
if !foundNS {
|
||||
args = append(args, fmt.Sprintf("--namespace=%s", popNamespace.Name))
|
||||
framework.Logf("container name: %s", container.Name)
|
||||
}
|
||||
if !foundImage {
|
||||
args = append(args, fmt.Sprintf("--image-name=%s", container.Image))
|
||||
framework.Logf("container image: %s", container.Image)
|
||||
}
|
||||
container.Args = args
|
||||
item.Spec.Template.Spec.Containers[i] = container
|
||||
default:
|
||||
|
Loading…
Reference in New Issue
Block a user