Merge pull request #13595 from iPraveenParihar/fix/issue-13578

csi: fix cephFS struct overwrite
This commit is contained in:
Travis Nielsen authored and GitHub committed 2024-01-19 14:08:47 -07:00
commit 4da7ee77f3
2 files changed
+11 -10

No files matched your search

+5 -8
View File
@@ -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
}
}
+6 -2
View File
@@ -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",
},
},
},