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

Internal error occurred: add operation does not apply: doc is missing path: "/spec/containers/0/volumeMounts/-": missing value

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done-Errata
    • Icon: Critical Critical
    • None
    • 4.12
    • Networking / SR-IOV
    • None
    • Moderate
    • No
    • CNF Network Sprint 238, CNF Network Sprint 239, CNF Network Sprint 240
    • 3
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      ReplicaSet/Sts can not generate Pods with SR-IOV network and "automountServiceAccountToken: false". The error message is
      
      Internal error occurred: add operation does not apply: doc is missing path: "/spec/containers/0/volumeMounts/-": missing value

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

      4.12

      How reproducible:

      100%

      Steps to Reproduce:

      1. Create SNNP and SriovNetwork
      2. Create such deployment:
      
      apiVersion: apps/v1
      kind: Deployment
      metadata:
        name: mysql
      spec:
        selector:
          matchLabels:
            app: mysql
        serviceName: mysql
        replicas: 1
        template:
          metadata:
            annotations:
              k8s.v1.cni.cncf.io/networks: sriov-intel
            labels:
              app: mysql
          spec:
            containers:
            - name: mysql
              image: quay.io/rhn_support_cchen/toolbox:v1.0
            automountServiceAccountToken: false
      
      The net-attach-def is typically using sriov type:
      
      $ oc get net-attach-def -o yaml sriov-intel
      apiVersion: k8s.cni.cncf.io/v1
      kind: NetworkAttachmentDefinition
      metadata:
        annotations:
          k8s.v1.cni.cncf.io/resourceName: openshift.io/sriov_netdevice_enp130s0f0
        creationTimestamp: "2023-05-08T08:39:26Z"
        generation: 1
        name: sriov-intel
        namespace: test-sriov
        resourceVersion: "39283986"
        uid: 50e52e71-e71c-447e-81cf-83c3755d8017
      spec:
        config: '{ "cniVersion":"0.3.1", "name":"sriov-intel","type":"sriov","vlan":183,"spoofchk":"off","vlanQoS":0,"ipam":{"type":"host-local","subnet":"10.72.51.0/27","rangeStart":"10.72.51.25","rangeEnd":"10.72.51.29","routes":[{"dst":"0.0.0.0/0"}],"gateway":"10.72.51.30"}
          }'
      
      3. But the deployment can not spawn Pod with this error
      
      19s         Warning   FailedCreate        replicaset/mysql-57467c8b59   Error creating: Internal error occurred: add operation does not apply: doc is missing path: "/spec/containers/0/volumeMounts/-": missing value 

      Actual results:

       

      Expected results:

       

      Additional info:

       

              apanatto@redhat.com Andrea Panattoni
              rhn-support-cchen Chen Chen
              Zhanqi Zhao Zhanqi Zhao
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: