Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const OCS_MULTIPLE_CLUSTER_NS = 'openshift-storage-extended';
const StorageClassSelection: React.FC<StorageClassSelectionProps> = ({
dispatch,
selected,
isTNFEnabled,
}) => {
const { t } = useCustomTranslation();

Expand All @@ -64,13 +65,22 @@ const StorageClassSelection: React.FC<StorageClassSelectionProps> = ({
[selected.name]
);

const filterResource = React.useCallback(
(sc: StorageClassResourceKind) => {
if (!isTNFEnabled) return true;
return sc.provisioner === NO_PROVISIONER;
},
[isTNFEnabled]
);

return (
<div className="odf-backing-storage__selection--width">
<ResourceDropdown
resource={scResource}
resourceModel={StorageClassModel}
onSelect={onStorageClassSelect}
secondaryTextGenerator={getStorageClassDescription}
filterResource={filterResource}
initialSelection={getInitialSelection}
data-test="storage-class-dropdown"
>
Expand All @@ -95,6 +105,7 @@ const StorageClassSelection: React.FC<StorageClassSelectionProps> = ({
type StorageClassSelectionProps = {
dispatch: WizardDispatch;
selected: WizardState['storageClass'];
isTNFEnabled: boolean;
};

export const BackingStorage: React.FC<BackingStorageProps> = ({
Expand Down Expand Up @@ -260,6 +271,7 @@ export const BackingStorage: React.FC<BackingStorageProps> = ({
<StorageClassSelection
dispatch={dispatch}
selected={storageClass}
isTNFEnabled={isTNFEnabled}
/>
)
}
Expand Down
Loading