Description of problem:
The oc explain pod.spec.containers command does not indicate that the image field is required. However, when creating a Pod with only the name field specified in containers, the Pod creation fails with an error indicating that spec.containers[0].image is a required field.
Version-Release number of selected component (if applicable):
4.16, 4.17, 4.18
How reproducible:
100%
Steps to Reproduce:
1. Define a pod yaml # cat pod.yaml apiVersion: v1 kind: Pod metadata: name: my-pod spec: containers: - name: nginx-container 2. Create the pod # oc create -f pod.yaml The Pod "my-pod" is invalid: spec.containers[0].image: Required value 3. Run oc explain # oc explain pod.spec.containers | grep -i required name <string> -required- Compute Resources required by this container. Cannot be updated. More info:
Actual results:
Pod creation fails due to missing image, even though oc explain does not mark image as required.
Expected results:
The oc explain pod.spec.containers should clearly indicate that image is a required field.
Additional info: