Przeglądaj źródła

Added namespace filtering for kube events to frontend

jnfrati 4 lat temu
rodzic
commit
2de79423b4

+ 3 - 0
dashboard/src/components/events/useEvents.ts

@@ -9,6 +9,7 @@ type UseKubeEventsProps = {
   ownerName?: string;
   ownerType?: string;
   shouldWaitForOwner?: boolean;
+  ownerNamespace?: string;
 };
 
 export const useKubeEvents = ({
@@ -16,6 +17,7 @@ export const useKubeEvents = ({
   ownerName,
   ownerType,
   shouldWaitForOwner,
+  ownerNamespace,
 }: UseKubeEventsProps) => {
   const { currentCluster, currentProject } = useContext(Context);
   const [hasPorterAgent, setHasPorterAgent] = useState(false);
@@ -98,6 +100,7 @@ export const useKubeEvents = ({
             resource_type: type,
             owner_name: ownerName,
             owner_type: ownerType,
+            namespace: ownerNamespace,
           },
           { project_id, cluster_id }
         )

+ 1 - 0
dashboard/src/main/home/cluster-dashboard/expanded-chart/events/EventsTab.tsx

@@ -56,6 +56,7 @@ const EventsTab: React.FC<{
     resourceType: resourceType.value as any,
     ownerName: selectedController?.metadata?.name,
     ownerType: selectedController?.kind,
+    ownerNamespace: selectedController?.metadata?.namespace,
     shouldWaitForOwner: true,
   });
 

+ 1 - 0
dashboard/src/shared/api.tsx

@@ -1260,6 +1260,7 @@ const getKubeEvents = baseApi<
     resource_type: string;
     owner_type?: string;
     owner_name?: string;
+    namespace?: string;
   },
   { project_id: number; cluster_id: number }
 >("GET", ({ project_id, cluster_id }) => {