diff --git a/api/core/core.proto b/api/core/core.proto index b550d6bf23..75f9e58740 100644 --- a/api/core/core.proto +++ b/api/core/core.proto @@ -65,8 +65,9 @@ service Core { } /* - * ListRuntimeObjects lists Weave GitOps runtime components from a cluster. Weave GitOps runtime is composed of Flux runtime - * but also the other components in the ecosystem like TF-controller or Policy Agent. + * ListRuntimeObjects lists Weave GitOps runtime components. + * Weave GitOps runtime is composed of Flux runtime but also other components + * in the ecosystem like TF-controller or Policy Agent. */ rpc ListRuntimeObjects(ListRuntimeObjectsRequest) returns (ListRuntimeObjectsResponse) { @@ -76,8 +77,9 @@ service Core { } /* - * ListRuntimeCrds lists Weave GitOps runtime components CRDs from a cluster. Weave GitOps runtime is composed of Flux runtime - * but also the other components in the ecosystem like TF-controller or Policy Agent. + * ListRuntimeCrds lists Weave GitOps runtime components CRDs. + * Weave GitOps runtime is composed of Flux runtime but also other components + * in the ecosystem like TF-controller or Policy Agent. */ rpc ListRuntimeCrds(ListRuntimeCrdsRequest) returns (ListRuntimeCrdsResponse) { diff --git a/api/core/core.swagger.json b/api/core/core.swagger.json index 70febc2ac4..c701ae8789 100644 --- a/api/core/core.swagger.json +++ b/api/core/core.swagger.json @@ -604,6 +604,7 @@ }, "/v1/runtime_crds": { "get": { + "summary": "ListRuntimeCrds lists Weave GitOps runtime components CRDs from a cluster. Weave GitOps runtime is composed of Flux runtime\nbut also the other components in the ecosystem like TF-controller or Policy Agent.", "operationId": "Core_ListRuntimeCrds", "responses": { "200": { @@ -634,7 +635,7 @@ }, "/v1/runtime_objects": { "get": { - "summary": "ListRuntimeObjects lists Weave GitOps runtime components from a clusters. Weave GitOps runtime is composed of Flux runtime\nbut also the other components in the ecosystem like TF-controller or Policy Agent.", + "summary": "ListRuntimeObjects lists Weave GitOps runtime components from a cluster. Weave GitOps runtime is composed of Flux runtime\nbut also the other components in the ecosystem like TF-controller or Policy Agent.", "operationId": "Core_ListRuntimeObjects", "responses": { "200": { diff --git a/pkg/api/core/core_grpc.pb.go b/pkg/api/core/core_grpc.pb.go index 882b563705..76e5b41b7d 100644 --- a/pkg/api/core/core_grpc.pb.go +++ b/pkg/api/core/core_grpc.pb.go @@ -25,9 +25,11 @@ type CoreClient interface { // ListFluxRuntimeObjects lists the flux runtime deployments from a cluster. ListFluxRuntimeObjects(ctx context.Context, in *ListFluxRuntimeObjectsRequest, opts ...grpc.CallOption) (*ListFluxRuntimeObjectsResponse, error) ListFluxCrds(ctx context.Context, in *ListFluxCrdsRequest, opts ...grpc.CallOption) (*ListFluxCrdsResponse, error) - // ListRuntimeObjects lists Weave GitOps runtime components from a clusters. Weave GitOps runtime is composed of Flux runtime + // ListRuntimeObjects lists Weave GitOps runtime components from a cluster. Weave GitOps runtime is composed of Flux runtime // but also the other components in the ecosystem like TF-controller or Policy Agent. ListRuntimeObjects(ctx context.Context, in *ListRuntimeObjectsRequest, opts ...grpc.CallOption) (*ListRuntimeObjectsResponse, error) + // ListRuntimeCrds lists Weave GitOps runtime components CRDs from a cluster. Weave GitOps runtime is composed of Flux runtime + // but also the other components in the ecosystem like TF-controller or Policy Agent. ListRuntimeCrds(ctx context.Context, in *ListRuntimeCrdsRequest, opts ...grpc.CallOption) (*ListRuntimeCrdsResponse, error) // GetReconciledObjects returns a list of objects that were created // as a result of reconciling a Flux automation. @@ -287,9 +289,11 @@ type CoreServer interface { // ListFluxRuntimeObjects lists the flux runtime deployments from a cluster. ListFluxRuntimeObjects(context.Context, *ListFluxRuntimeObjectsRequest) (*ListFluxRuntimeObjectsResponse, error) ListFluxCrds(context.Context, *ListFluxCrdsRequest) (*ListFluxCrdsResponse, error) - // ListRuntimeObjects lists Weave GitOps runtime components from a clusters. Weave GitOps runtime is composed of Flux runtime + // ListRuntimeObjects lists Weave GitOps runtime components from a cluster. Weave GitOps runtime is composed of Flux runtime // but also the other components in the ecosystem like TF-controller or Policy Agent. ListRuntimeObjects(context.Context, *ListRuntimeObjectsRequest) (*ListRuntimeObjectsResponse, error) + // ListRuntimeCrds lists Weave GitOps runtime components CRDs from a cluster. Weave GitOps runtime is composed of Flux runtime + // but also the other components in the ecosystem like TF-controller or Policy Agent. ListRuntimeCrds(context.Context, *ListRuntimeCrdsRequest) (*ListRuntimeCrdsResponse, error) // GetReconciledObjects returns a list of objects that were created // as a result of reconciling a Flux automation. diff --git a/ui/App.tsx b/ui/App.tsx index b0aea99e59..c700ad368d 100644 --- a/ui/App.tsx +++ b/ui/App.tsx @@ -202,15 +202,12 @@ const App = () => { component={withSearchParams(PolicyViolationPage)} /> - - - diff --git a/ui/components/FluxRuntime.tsx b/ui/components/FluxRuntime.tsx index ad18bc97b8..131b2b2206 100644 --- a/ui/components/FluxRuntime.tsx +++ b/ui/components/FluxRuntime.tsx @@ -52,17 +52,19 @@ function FluxRuntime({ className, deployments, crds }: Props) { }, ]; const fluxVersions: { [key: string]: FluxVersion } = {}; - deployments.filter( (d) => d.labels[partOfLabel] == fluxLabel ).forEach((d) => { - const fv = d.labels[fluxVersionLabel]; - const k = `${fv}${d.clusterName}${d.namespace}`; - if (!fluxVersions[k]) { - fluxVersions[k] = { - version: fv, - clusterName: d.clusterName, - namespace: d.namespace, - }; - } - }); + deployments + .filter((d) => d.labels[partOfLabel] == fluxLabel) + .forEach((d) => { + const fv = d.labels[fluxVersionLabel]; + const k = `${fv}${d.clusterName}${d.namespace}`; + if (!fluxVersions[k]) { + fluxVersions[k] = { + version: fv, + clusterName: d.clusterName, + namespace: d.namespace, + }; + } + }); const supportMultipleFlux = true; diff --git a/ui/hooks/flux.ts b/ui/hooks/flux.ts index 7f64c19726..3788f8def2 100644 --- a/ui/hooks/flux.ts +++ b/ui/hooks/flux.ts @@ -3,7 +3,8 @@ import { useMutation, useQuery, useQueryClient } from "react-query"; import { CoreClientContext } from "../contexts/CoreClientContext"; import { ListFluxCrdsResponse, - ListFluxRuntimeObjectsResponse, ListRuntimeObjectsResponse, + ListFluxRuntimeObjectsResponse, + ListRuntimeObjectsResponse, ToggleSuspendResourceRequest, ToggleSuspendResourceResponse, } from "../lib/api/core/core.pb"; @@ -52,22 +53,22 @@ export function useListRuntimeObjects( refetchInterval: 5000, } ) { - const { api } = useContext(CoreClientContext); + const {api} = useContext(CoreClientContext); return useQuery( "runtime_objects", - () => api.ListRuntimeObjects({ namespace, clusterName }), + () => api.ListRuntimeObjects({namespace, clusterName}), opts ); } export function useListRuntimeCrds(clusterName = DefaultCluster) { - const { api } = useContext(CoreClientContext); + const {api} = useContext(CoreClientContext); return useQuery( "runtime_crds", - () => api.ListRuntimeCrds({ clusterName }), - { retry: false, refetchInterval: 5000 } + () => api.ListRuntimeCrds({clusterName}), + {retry: false, refetchInterval: 5000} ); } diff --git a/ui/pages/v2/FluxRuntime.tsx b/ui/pages/v2/FluxRuntime.tsx index 6570b41f80..db100735ce 100644 --- a/ui/pages/v2/FluxRuntime.tsx +++ b/ui/pages/v2/FluxRuntime.tsx @@ -16,8 +16,7 @@ function FluxRuntime({ className }: Props) { error: crdsError, } = useListFluxCrds(); return ( - -