Skip to content

Commit

Permalink
use CephNetworkType enum in the function argument
Browse files Browse the repository at this point in the history
update `validateMultusSelectors` function to use `map[CephNetworkType]string`
instead of `map[string]string

Signed-off-by: sp98 <[email protected]>
(cherry picked from commit 8f36536)
  • Loading branch information
sp98 committed Oct 17, 2023
1 parent 8ee0ec3 commit bfeba5d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ func isMultus(nwSpec *rookCephv1.NetworkSpec) bool {
return false
}

func validateMultusSelectors(selectors map[string]string) error {
func validateMultusSelectors(selectors map[rookCephv1.CephNetworkType]string) error {
publicNetwork, validPublicNetworkKey := selectors[publicNetworkSelectorKey]
clusterNetwork, validClusterNetworkKey := selectors[clusterNetworkSelectorKey]
if !validPublicNetworkKey && !validClusterNetworkKey {
Expand Down
6 changes: 3 additions & 3 deletions controllers/storagecluster/storagecluster_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1109,9 +1109,9 @@ func TestStorageClusterOnMultus(t *testing.T) {
if c.testCase != "default" {
c.cr.Spec.Network = &rookCephv1.NetworkSpec{
Provider: networkProvider,
Selectors: map[string]string{
"public": c.publicNW,
"cluster": c.clusterNW,
Selectors: map[rookCephv1.CephNetworkType]string{
rookCephv1.CephNetworkPublic: c.publicNW,
rookCephv1.CephNetworkCluster: c.clusterNW,
},
}
}
Expand Down

0 comments on commit bfeba5d

Please sign in to comment.