1
1
import * as React from 'react' ;
2
2
import NamespaceSafetyBox from '@odf/core/components/utils/safety-box' ;
3
3
import { useNodesData } from '@odf/core/hooks' ;
4
- import { useODFNamespaceSelector } from '@odf/core/redux' ;
5
4
import { NodeData } from '@odf/core/types' ;
6
5
import { getStorageClassDescription } from '@odf/core/utils' ;
7
6
import { getCephNodes } from '@odf/ocs/utils/common' ;
@@ -17,7 +16,7 @@ import { CommonModalProps } from '@odf/shared/modals/common';
17
16
import { ModalBody , ModalFooter , ModalHeader } from '@odf/shared/modals/Modal' ;
18
17
import { StorageClusterModel } from '@odf/shared/models' ;
19
18
import { PersistentVolumeModel , StorageClassModel } from '@odf/shared/models' ;
20
- import { getName } from '@odf/shared/selectors' ;
19
+ import { getName , getNamespace } from '@odf/shared/selectors' ;
21
20
import {
22
21
StorageClassResourceKind ,
23
22
StorageClusterKind ,
@@ -199,9 +198,9 @@ export const AddCapacityModal: React.FC<AddCapacityModalProps> = ({
199
198
} ) => {
200
199
const { t } = useCustomTranslation ( ) ;
201
200
202
- const { odfNamespace } = useODFNamespaceSelector ( ) ;
203
-
201
+ const ocsClusterNs = getNamespace ( ocsConfig ) ;
204
202
const ocsClusterName = getName ( ocsConfig ) ;
203
+
205
204
const [ cephTotal , totalError , totalLoading ] = useCustomPrometheusPoll ( {
206
205
endpoint : 'api/v1/query' as PrometheusEndpoint ,
207
206
query :
@@ -251,7 +250,7 @@ export const AddCapacityModal: React.FC<AddCapacityModalProps> = ({
251
250
const replica = getDeviceSetReplica (
252
251
isArbiterEnabled ,
253
252
hasFlexibleScaling ,
254
- createWizardNodeState ( getCephNodes ( nodesData , odfNamespace ) as NodeData [ ] )
253
+ createWizardNodeState ( getCephNodes ( nodesData , ocsClusterNs ) as NodeData [ ] )
255
254
) ;
256
255
257
256
const totalCapacityMetric = values ?. [ 0 ] ;
0 commit comments