Skip to content

Commit 10ed80e

Browse files
authored
fix(tekton): handle flaky cluster error gracefully (#887)
1 parent 95e430e commit 10ed80e

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

plugins/tekton/src/hooks/useTektonObjectsResponse.ts

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import { useParams } from 'react-router-dom';
32

43
import { useEntity } from '@backstage/plugin-catalog-react';
54
import { useKubernetesObjects } from '@backstage/plugin-kubernetes';
@@ -20,7 +19,6 @@ export const useTektonObjectsResponse = (
2019
watchedResource: string[],
2120
): TektonResourcesContextData => {
2221
const { entity } = useEntity();
23-
const { clusterName } = useParams();
2422
const { kubernetesObjects, loading, error } = useKubernetesObjects(entity);
2523
const [selectedCluster, setSelectedCluster] = React.useState<number>(0);
2624
const [selectedStatus, setSelectedStatus] = React.useState<string>(
@@ -53,18 +51,6 @@ export const useTektonObjectsResponse = (
5351
error,
5452
});
5553

56-
React.useEffect(() => {
57-
if (
58-
clusterName &&
59-
clusters?.length > 0 &&
60-
clusters.indexOf(clusterName) > 0
61-
) {
62-
setSelectedCluster(clusters.indexOf(clusterName));
63-
} else {
64-
setSelectedCluster(0);
65-
}
66-
}, [clusters, clusterName]);
67-
6854
const updateResults = React.useCallback(
6955
(resData, isLoading, errorData) => {
7056
if (!isLoading && !errorData && mounted.current) {

0 commit comments

Comments
 (0)