3
3
STORAGE_CLUSTER_SYSTEM_KIND ,
4
4
NO_PROVISIONER ,
5
5
} from '@odf/core/constants' ;
6
+ import { PROVIDER_MODE } from '@odf/core/features' ;
6
7
import { useSafeK8sGet } from '@odf/core/hooks' ;
7
8
import { useODFNamespaceSelector } from '@odf/core/redux' ;
8
9
import { scResource } from '@odf/core/resources' ;
@@ -25,6 +26,7 @@ import {
25
26
} from '@odf/shared/types' ;
26
27
import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook' ;
27
28
import { isDefaultClass , getODFCsv , getGVKLabel } from '@odf/shared/utils' ;
29
+ import { useFlag } from '@openshift-console/dynamic-plugin-sdk' ;
28
30
import * as _ from 'lodash-es' ;
29
31
import {
30
32
Form ,
@@ -213,6 +215,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
213
215
214
216
const isFullDeployment = deployment === DeploymentType . FULL ;
215
217
const isProviderMode = deployment === DeploymentType . PROVIDER_MODE ;
218
+ const isProviderModePresent = useFlag ( PROVIDER_MODE ) && hasInternal ;
216
219
const isNonRHCSExternalType =
217
220
type === BackingStorageType . EXTERNAL &&
218
221
externalStorage !== OCSStorageClusterModel . kind ;
@@ -269,7 +272,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
269
272
* Allow pre selecting the "external connection" option instead of the "existing" option
270
273
* if an OCS Storage System is already created.
271
274
*/
272
- if ( hasOCS && allowedExternalStorage . length ) {
275
+ if ( hasOCS && allowedExternalStorage . length && ! isProviderModePresent ) {
273
276
dispatch ( {
274
277
type : 'backingStorage/setType' ,
275
278
payload : BackingStorageType . EXTERNAL ,
@@ -282,7 +285,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
282
285
} ,
283
286
} ) ;
284
287
}
285
- } , [ dispatch , allowedExternalStorage . length , hasOCS ] ) ;
288
+ } , [ dispatch , allowedExternalStorage . length , hasOCS , isProviderModePresent ] ) ;
286
289
287
290
React . useEffect ( ( ) => {
288
291
/*
@@ -384,7 +387,11 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
384
387
value = { BackingStorageType . EXTERNAL }
385
388
isChecked = { type === BackingStorageType . EXTERNAL }
386
389
onChange = { ( event , _unused ) => onRadioSelect ( _unused , event ) }
387
- isDisabled = { allowedExternalStorage . length === 0 || isProviderMode }
390
+ isDisabled = {
391
+ allowedExternalStorage . length === 0 ||
392
+ isProviderMode ||
393
+ isProviderModePresent
394
+ }
388
395
body = {
389
396
showExternalStorageSelection && (
390
397
< ExternalSystemSelection
0 commit comments