IBM / ibm-spectrum-scale-csi

The IBM Spectrum Scale Container Storage Interface (CSI) project enables container orchestrators, such as Kubernetes and OpenShift, to manage the life-cycle of persistent storage.
Apache License 2.0
66 stars 49 forks source link

CSI DamonSet got failed when two remote clusters are using same secret #568

Closed JimmyMa closed 3 weeks ago

JimmyMa commented 2 years ago

Describe the bug

When two or more remote clusters are using the same secret, the generated DaemonSet is incorrect, which contains duplicated volumns, the CSI operator has below error:

[localhost]: FAILED! => {"changed": false, "error": 422, "msg": "Failed to create object: b'{\"kind\":\"Status\",\"apiVersion\":\"v1\",\"metadata\":{},\"status\":\"Failure\",\"message\":\"DaemonSet.apps \\\\\"ibm-spectrum-scale-csi\\\\\" is invalid: [spec.template.spec.volumes[7].name: Duplicate value: \\\\\"csi-remote-mount-storage-cluster-1\\\\\", spec.template.spec.containers[2].volumeMounts[6].mountPath: Invalid value: \\\\\"/var/lib/ibm/csi-remote-mount-storage-cluster-1\\\\\": must be unique]\",\"reason\":\"Invalid\",\"details\":{\"name\":\"ibm-spectrum-scale-csi\",\"group\":\"apps\",\"kind\":\"DaemonSet\",\"causes\":[{\"reason\":\"FieldValueDuplicate\",\"message\":\"Duplicate value: \\\\\"csi-remote-mount-storage-cluster-1\\\\\"\",\"field\":\"spec.template.spec.volumes[7].name\"},{\"reason\":\"FieldValueInvalid\",\"message\":\"Invalid value: \\\\\"/var/lib/ibm/csi-remote-mount-storage-cluster-1\\\\\": must be unique\",\"field\":\"spec.template.spec.containers[2].volumeMounts[6].mountPath\"}]},\"code\":422}\\n'", "reason": "Unprocessable Entity", "status": 422}

The csiscaleoperator CR contains below content:

    clusters:

    - id: "12662918776986608989"

      primary:

        inodeLimit: ""

        primaryFs: xxx

        primaryFset: spectrum-scale-csi-volume-store

        remoteCluster: "9745237541502797923"

      restApi:

      - guiHost: ibm-spectrum-scale-gui.ibm-spectrum-scale

      secrets: ibm-spectrum-scale-gui-csiadmin

      secureSslMode: false

    - id: "9745237541502797923"

      primary:

        inodeLimit: ""

        primaryFs: ""

        primaryFset: ""

        remoteCluster: ""

      restApi:

      - guiHost: xxxx

        guiPort: 443

      secrets: csi-remote-mount-storage-cluster-1

      secureSslMode: false

    - id: "1238687867089981087"

      primary:

        inodeLimit: ""

        primaryFs: ""

        primaryFset: ""

        remoteCluster: ""

      restApi:

      - guiHost: xxxx

        guiPort: 443

      secrets: csi-remote-mount-storage-cluster-1

      secureSslMode: false

How to Reproduce?

Please list the steps to help development teams reproduce the behavior

  1. create two remote clusters using the same secret

Expected behavior

CSI should support clusters share the same secret

Data Collection and Debugging

CNSA: 5.1.1.4

deeghuge commented 2 years ago

Hi @JimmyMa This issue is good to have. It is not being considering for upcoming release.

deeghuge commented 3 weeks ago

Closing as working as designed