Merge pull request #13595 from iPraveenParihar/fix/issue-13578
csi: fix cephFS struct overwrite
This commit is contained in:
2 files changed
+11
-10
No files matched your search
@@ -271,14 +271,11 @@ func updateCSIDriverOptions(curr, clusterKey string,
|
||||
for i := range cc {
|
||||
// If the clusterID belongs to the same cluster, update the entry.
|
||||
if clusterKey == cc[i].Namespace {
|
||||
cc[i].ReadAffinity = cephcsi.ReadAffinity{
|
||||
Enabled: csiDriverOptions.ReadAffinity.Enabled,
|
||||
CrushLocationLabels: csiDriverOptions.ReadAffinity.CrushLocationLabels,
|
||||
}
|
||||
cc[i].CephFS = cephcsi.CephFS{
|
||||
KernelMountOptions: csiDriverOptions.CephFS.KernelMountOptions,
|
||||
FuseMountOptions: csiDriverOptions.CephFS.FuseMountOptions,
|
||||
}
|
||||
cc[i].ReadAffinity.Enabled = csiDriverOptions.ReadAffinity.Enabled
|
||||
cc[i].ReadAffinity.CrushLocationLabels = csiDriverOptions.ReadAffinity.CrushLocationLabels
|
||||
|
||||
cc[i].CephFS.KernelMountOptions = csiDriverOptions.CephFS.KernelMountOptions
|
||||
cc[i].CephFS.FuseMountOptions = csiDriverOptions.CephFS.FuseMountOptions
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -474,6 +474,9 @@ func TestUpdateCSIDriverOptions(t *testing.T) {
|
||||
ClusterInfo: cephcsi.ClusterInfo{
|
||||
ClusterID: "rook-ceph",
|
||||
Monitors: []string{"1.1.1.1"},
|
||||
CephFS: cephcsi.CephFS{
|
||||
NetNamespaceFilePath: "netnamespacefilepath",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -500,8 +503,9 @@ func TestUpdateCSIDriverOptions(t *testing.T) {
|
||||
CrushLocationLabels: []string{"topology.rook.io/rack"},
|
||||
},
|
||||
CephFS: cephcsi.CephFS{
|
||||
KernelMountOptions: "rw,noatime",
|
||||
FuseMountOptions: "debug",
|
||||
KernelMountOptions: "rw,noatime",
|
||||
FuseMountOptions: "debug",
|
||||
NetNamespaceFilePath: "netnamespacefilepath",
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
Reference in new issue
Block a user