Skip to content

Commit

Permalink
csi: fix cephFS struct overwrite
Browse files Browse the repository at this point in the history
The updateCSIDriverOptions() func was overwriting the ClusterInfo.CephFS
struct. Due to which multus and csi hostnetwork canary tests were hanging.

Signed-off-by: Praveen M <[email protected]>
  • Loading branch information
iPraveenParihar committed Jan 19, 2024
1 parent f46c084 commit 117961e
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 117961e

Please sign in to comment.