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:
Humble Chirammal 2021-12-08 13:57:42 +05:30
parent f356ae4ad9
commit fa882f5aa4
2 changed files with 2 additions and 2 deletions

View File

@ -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]

View File

@ -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",