node_e2e: Fix createStaticSystemNodeCriticalPod's invalid spec

This fixes `createStaticSystemNodeCriticalPod` to set pod's
restartPolicy instead of container's restartPolicy.
This commit is contained in:
Gunju Kim 2023-07-20 20:07:41 +09:00
parent fa88c0b779
commit e0a6eb93a1
No known key found for this signature in database
GPG Key ID: 9300A528F3F0DAB7

View File

@ -146,11 +146,11 @@ spec:
containers:
- name: %s
image: %s
restartPolicy: %s
command: ["sh", "-c", "i=0; while [ $i -lt %d ]; do %s i=$(($i+1)); done; while true; do sleep 5; done"]
restartPolicy: %s
`
file := staticPodPath(dir, name, namespace)
podYaml := fmt.Sprintf(template, name, namespace, name, image, string(restart), iterations, command)
podYaml := fmt.Sprintf(template, name, namespace, name, image, iterations, command, string(restart))
f, err := os.OpenFile(file, os.O_RDWR|os.O_TRUNC|os.O_CREATE, 0666)
if err != nil {