mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
rbd: initialize ceph monitors slice with an empty value.
In translation lib rbd pluin, the monitors slice is nil which has to be initialized with an empty value. This commit address the same. Signed-off-by: Humble Chirammal <hchiramm@redhat.com>
This commit is contained in:
parent
f356ae4ad9
commit
fa882f5aa4
@ -219,7 +219,7 @@ func (p rbdCSITranslator) TranslateCSIPVToInTree(pv *v1.PersistentVolume) (*v1.P
|
||||
return nil, fmt.Errorf("pv is nil or CSI source not defined on pv")
|
||||
}
|
||||
var rbdImageName string
|
||||
var monSlice []string
|
||||
monSlice := []string{""}
|
||||
csiSource := pv.Spec.CSI
|
||||
|
||||
rbdImageName = csiSource.VolumeAttributes[imgNameKey]
|
||||
|
@ -415,7 +415,7 @@ func TestTranslateCSIPvToInTree(t *testing.T) {
|
||||
},
|
||||
PersistentVolumeSource: v1.PersistentVolumeSource{
|
||||
RBD: &v1.RBDPersistentVolumeSource{
|
||||
CephMonitors: nil,
|
||||
CephMonitors: []string{""},
|
||||
RBDPool: "replicapool",
|
||||
RBDImage: "kubernetes-dynamic-pvc-e4111eb6-4088-11ec-b823-0242ac110003",
|
||||
RadosUser: "admin",
|
||||
|
Loading…
Reference in New Issue
Block a user