Skip to content

Commit

Permalink
Merge pull request #1049 from SanjalKatiyar/add_cap_sc_dropdown
Browse files Browse the repository at this point in the history
fix StorageClass filtering for add capacity modal
  • Loading branch information
openshift-merge-robot authored Sep 20, 2023
2 parents 94b95d9 + 179bccf commit 4f5269c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/odf/modals/add-capacity/add-capacity-modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ type StorageClassDropdownProps = {
onChange: any;
'data-test': string;
initialSelection: (args) => any;
filter: (resource: StorageClassResourceKind) => boolean;
filter: (resource: StorageClassResourceKind) => StorageClassResourceKind;
};

const StorageClassDropdown: React.FC<StorageClassDropdownProps> = ({
Expand Down Expand Up @@ -275,10 +275,10 @@ export const AddCapacityModal: React.FC<AddCapacityModalProps> = ({
(item) => getName(item) === installStorageClass
);
if (initialSC?.provisioner === NO_PROVISIONER) {
return sc.provisioner === NO_PROVISIONER;
return sc.provisioner === NO_PROVISIONER ? sc : undefined;
}
}
return true;
return sc;
},
[installStorageClass, scResources, scResourcesLoadError, scResourcesLoaded]
);
Expand Down
1 change: 1 addition & 0 deletions packages/odf/utils/ocs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ export const getDeviceSetCount = (pvCount: number, replica: number): number =>
Math.floor(pvCount / replica) || 1;

export const filterSC = (sc: StorageClassResourceKind) =>
!!sc &&
!OCS_PROVISIONERS.some((ocsProvisioner: string) =>
sc?.provisioner?.includes(ocsProvisioner)
);
Expand Down

0 comments on commit 4f5269c

Please sign in to comment.