33 STORAGE_CLUSTER_SYSTEM_KIND ,
44 NO_PROVISIONER ,
55} from '@odf/core/constants' ;
6+ import { PROVIDER_MODE } from '@odf/core/features' ;
67import { useSafeK8sGet } from '@odf/core/hooks' ;
78import { useODFNamespaceSelector } from '@odf/core/redux' ;
89import { scResource } from '@odf/core/resources' ;
@@ -25,6 +26,7 @@ import {
2526} from '@odf/shared/types' ;
2627import { useCustomTranslation } from '@odf/shared/useCustomTranslationHook' ;
2728import { isDefaultClass , getODFCsv , getGVKLabel } from '@odf/shared/utils' ;
29+ import { useFlag } from '@openshift-console/dynamic-plugin-sdk' ;
2830import * as _ from 'lodash-es' ;
2931import {
3032 Form ,
@@ -213,6 +215,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
213215
214216 const isFullDeployment = deployment === DeploymentType . FULL ;
215217 const isProviderMode = deployment === DeploymentType . PROVIDER_MODE ;
218+ const isProviderModePresent = useFlag ( PROVIDER_MODE ) && hasInternal ;
216219 const isNonRHCSExternalType =
217220 type === BackingStorageType . EXTERNAL &&
218221 externalStorage !== OCSStorageClusterModel . kind ;
@@ -269,7 +272,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
269272 * Allow pre selecting the "external connection" option instead of the "existing" option
270273 * if an OCS Storage System is already created.
271274 */
272- if ( hasOCS && allowedExternalStorage . length ) {
275+ if ( hasOCS && allowedExternalStorage . length && ! isProviderModePresent ) {
273276 dispatch ( {
274277 type : 'backingStorage/setType' ,
275278 payload : BackingStorageType . EXTERNAL ,
@@ -282,7 +285,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
282285 } ,
283286 } ) ;
284287 }
285- } , [ dispatch , allowedExternalStorage . length , hasOCS ] ) ;
288+ } , [ dispatch , allowedExternalStorage . length , hasOCS , isProviderModePresent ] ) ;
286289
287290 React . useEffect ( ( ) => {
288291 /*
@@ -384,7 +387,11 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
384387 value = { BackingStorageType . EXTERNAL }
385388 isChecked = { type === BackingStorageType . EXTERNAL }
386389 onChange = { ( event , _unused ) => onRadioSelect ( _unused , event ) }
387- isDisabled = { allowedExternalStorage . length === 0 || isProviderMode }
390+ isDisabled = {
391+ allowedExternalStorage . length === 0 ||
392+ isProviderMode ||
393+ isProviderModePresent
394+ }
388395 body = {
389396 showExternalStorageSelection && (
390397 < ExternalSystemSelection
0 commit comments