Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-55319

oc explain for pod.spec.containers is misleading—does not mark image field as required

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Normal Normal
    • None
    • 4.18
    • oc
    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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:

          

              aguclu@redhat.com Arda Guclu
              rhn-support-dpateriy Divyam Pateriya
              None
              None
              Ying Zhou Ying Zhou
              None
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: