Skip to content

Commit

Permalink
fix: Filter clusters by status of ready in kubectl modal (#4317)
Browse files Browse the repository at this point in the history
fix: Filter ready clusters in KubectlModal onSuccess callback

Signed-off-by: yazhou <[email protected]>
  • Loading branch information
yazhouio authored Sep 25, 2024
1 parent 5cc554f commit cd70c1d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/shared/src/components/Modals/KubeCtl/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ export function KubectlModal({ visible, title, params, onCancel }: KubectlModalP
} = fetchGrantedList(
{ limit: -1 },
{
onSuccess: (arr: FormattedCluster[]) => {
onSuccess: (list: FormattedCluster[]) => {
const arr = list.filter(({ isReady }) => isReady);
if (!selectedCluster || arr.findIndex(({ name }) => name === selectedCluster) === -1) {
setSelectedCluster(arr[0]?.name);
}
Expand Down

0 comments on commit cd70c1d

Please sign in to comment.