diff --git a/assets/src/components/cluster/pods/PodsList.tsx b/assets/src/components/cluster/pods/PodsList.tsx index 7b65557423..217acf4bce 100644 --- a/assets/src/components/cluster/pods/PodsList.tsx +++ b/assets/src/components/cluster/pods/PodsList.tsx @@ -1,7 +1,14 @@ import { A, Div, Flex, Span } from 'honorable' import { Link, useNavigate } from 'react-router-dom' import { Row, createColumnHelper } from '@tanstack/react-table' -import { ComponentProps, memo, useMemo, useState } from 'react' +import { + ComponentProps, + createContext, + memo, + useContext, + useMemo, + useState, +} from 'react' import { filesize } from 'filesize' import type { Application, Maybe, Pod } from 'generated/graphql' @@ -34,11 +41,21 @@ import { ContainerStatuses } from '../ContainerStatuses' import { getPodResources } from './getPodResources' -function DeletePod({ name, namespace, refetch }) { +function DeletePod({ + name, + namespace, + refetch, + serviceId, +}: { + name: string + namespace: string + refetch: any + serviceId?: string | null +}) { const [confirm, setConfirm] = useState(false) const [mutation, { loading }] = useMutation(DELETE_POD, { - variables: { name, namespace }, + variables: { name, namespace, serviceId }, onCompleted: () => { setConfirm(false) refetch() @@ -260,13 +277,18 @@ export const ColActions = (refetch) => export const ColDelete = (refetch) => columnHelper.accessor((row) => row.name, { id: 'delete', - cell: ({ row: { original } }) => ( - - ), + cell: ({ row: { original } }) => { + const ctx = useContext(PodsListContext) + + return ( + + ) + }, header: '', }) @@ -278,6 +300,7 @@ type PodListProps = Omit, 'data'> & { applications?: Maybe[]> columns: any[] linkBasePath?: string + serviceId?: string | null } function getRestarts(status: Pod['status']) { @@ -304,11 +327,14 @@ function getPodImages(spec: Pod['spec']) { ] } +const PodsListContext = createContext({}) + export const PodsList = memo( ({ pods, applications, columns, + serviceId, linkBasePath = `/pods`, ...props }: PodListProps) => { @@ -356,15 +382,17 @@ export const PodsList = memo( } return ( - ) => - navigate(`${linkBasePath}/${original.namespace}/${original.name}`) - } - /> + +
) => + navigate(`${linkBasePath}/${original.namespace}/${original.name}`) + } + /> + ) } ) diff --git a/assets/src/components/cluster/queries.js b/assets/src/components/cluster/queries.js index dc86d0c7ea..edcaf777d2 100644 --- a/assets/src/components/cluster/queries.js +++ b/assets/src/components/cluster/queries.js @@ -14,8 +14,8 @@ import { } from 'components/graphql/kubernetes' export const DELETE_POD = gql` - mutation DeletePod($name: String!, $namespace: String!) { - deletePod(name: $name, namespace: $namespace) { + mutation DeletePod($name: String!, $namespace: String!, $serviceId: ID) { + deletePod(name: $name, namespace: $namespace, serviceId: $serviceId) { ...PodFragment } } diff --git a/assets/src/components/component/info/Pods.tsx b/assets/src/components/component/info/Pods.tsx index 96d3b7d1ba..9da84e0aca 100644 --- a/assets/src/components/component/info/Pods.tsx +++ b/assets/src/components/component/info/Pods.tsx @@ -21,7 +21,7 @@ import { InfoSectionH2 } from './common' export default function Pods({ pods }) { const clusterId = useParams()[SERVICE_PARAM_CLUSTER_ID] - const { refetch } = useOutletContext() + const { refetch, ...rest } = useOutletContext() const theme = useTheme() const columns = useMemo( () => [ @@ -55,6 +55,7 @@ export default function Pods({ pods }) { - deploys the plural console and additional dependencies, for use in bring-your-own-kube setups appVersion: 0.7.7 -version: 0.1.14 +version: 0.1.15 dependencies: - name: kas version: 0.0.3 diff --git a/charts/console/templates/migration.yaml b/charts/console/templates/migration.yaml index af1d47c537..b8e6fb7ce8 100644 --- a/charts/console/templates/migration.yaml +++ b/charts/console/templates/migration.yaml @@ -1,13 +1,14 @@ apiVersion: batch/v1 kind: Job metadata: - name: console-migration-{{ .Values.image.tag | default .Chart.AppVersion | sha256sum | trunc 8 }} + name: console-migration-v2-{{ .Values.image.tag | default .Chart.AppVersion | sha256sum | trunc 8 }} labels: platform.plural.sh/ignore: 'true' {{ include "console.labels" . | nindent 4 }} spec: template: spec: + serviceAccountName: console {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 6 }}