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

Error while validating NetworkAttachmentDefinition with empty spec

XMLWordPrintable

    • Quality / Stability / Reliability
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • Rejected
    • CORENET Sprint 275
    • 1
    • ?
    • In Progress
    • Release Note Not Required
    • None
    • None
    • None
    • None
    • None

      Description of problem:

      When updating a NetworkAttachmentDefinition with an empty spec, the validation returns an error preventing you from updating the object.
      
      Error from server (Forbidden): network-attachment-definitions.k8s.cni.cncf.io "empty-spec" is forbidden: expression 'oldObject == null || object == null || object.spec != oldObject.spec' resulted in error: no such key: spec    

      Version-Release number of selected component (if applicable):

          4.19.7, 4.20

      How reproducible:

          Easily

      Steps to Reproduce:

          1. Create a NetworkAttachmentDefinition with an empty spec
      
      apiVersion: k8s.cni.cncf.io/v1
      kind: NetworkAttachmentDefinition
      metadata:
        name: empty-spec
        namespace: default
      
          2. Try and update it: 
      
      kubectl patch network-attachment-definitions.k8s.cni.cncf.io empty-spec --type=json -p '[{"op": "add", "path": "/metadata/annotations/test", "value": "val"}]'   

      Actual results:

          Error from server (Forbidden): network-attachment-definitions.k8s.cni.cncf.io "empty-spec" is forbidden: expression 'oldObject == null || object == null || object.spec != oldObject.spec' resulted in error: no such key: spec

      Expected results:

          Successful update

      Additional info:

      Issue is not present on 4.19.6 but shows up in 4.19.7 and on 4.20    

              pdiak@redhat.com Patryk Diak
              nfox@redhat.com Nick Fox
              None
              None
              Barbora Longauerova Barbora Longauerova
              None
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Created:
                Updated: