Skip to content

Commit

Permalink
refactor getOsdCount() to make it reusable
Browse files Browse the repository at this point in the history
Signed-off-by: Umanga Chapagain <[email protected]>
  • Loading branch information
umangachapagain committed Dec 12, 2023
1 parent 2b565e4 commit 2e5b088
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions controllers/storagecluster/cephcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -1308,8 +1308,8 @@ func isBluestore(store rookCephv1.OSDStore) bool {
return false
}

func (r *StorageClusterReconciler) getOsdCount(sc *ocsv1.StorageCluster) int {
storageClassDeviceSets := newStorageClassDeviceSets(sc, r.serverVersion)
func getOsdCount(sc *ocsv1.StorageCluster, serverVersion *version.Info) int {
storageClassDeviceSets := newStorageClassDeviceSets(sc, serverVersion)
osdCount := 0
for _, ds := range storageClassDeviceSets {
osdCount += ds.Count
Expand Down
2 changes: 1 addition & 1 deletion controllers/storagecluster/resourceprofile.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func (r *StorageClusterReconciler) ensureResourceProfileChangeApplied(sc *ocsv1.
}

// Verify if expected number of osd pods with the current resource profile label are running
if err := r.verifyDaemonWithResourceProfile(sc.Namespace, map[string]string{"app": "rook-ceph-osd", defaults.ODFResourceProfileKey: currentResourceProfile}, r.getOsdCount(sc)); err != nil {
if err := r.verifyDaemonWithResourceProfile(sc.Namespace, map[string]string{"app": "rook-ceph-osd", defaults.ODFResourceProfileKey: currentResourceProfile}, getOsdCount(sc, r.serverVersion)); err != nil {
return err
}

Expand Down

0 comments on commit 2e5b088

Please sign in to comment.