Skip to content

Commit

Permalink
Merge pull request rook#13595 from iPraveenParihar/fix/issue-13578
Browse files Browse the repository at this point in the history
csi: fix cephFS struct overwrite
  • Loading branch information
travisn authored Jan 19, 2024
2 parents d48b8ef + 117961e commit 4da7ee7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
13 changes: 5 additions & 8 deletions pkg/operator/ceph/csi/cluster_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down
8 changes: 6 additions & 2 deletions pkg/operator/ceph/csi/cluster_config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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",
},
},
},
},
Expand All @@ -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",
},
},
},
Expand Down

0 comments on commit 4da7ee7

Please sign in to comment.