ibm-spectrum-scale-csi
ibm-spectrum-scale-csi copied to clipboard
CSI DamonSet got failed when two remote clusters are using same secret
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
- 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