From 7473c564eb59a9d1f25af4ec0202826e5aa9ff03 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Sun, 1 Jan 2023 13:21:33 -0500 Subject: [PATCH] fix(plugins/plugin-kubectl): edit button ignores context and kubeconfig options --- plugins/plugin-kubectl/src/lib/view/modes/EditButton.tsx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/plugins/plugin-kubectl/src/lib/view/modes/EditButton.tsx b/plugins/plugin-kubectl/src/lib/view/modes/EditButton.tsx index 6f6c497ff43..07acc461ef8 100644 --- a/plugins/plugin-kubectl/src/lib/view/modes/EditButton.tsx +++ b/plugins/plugin-kubectl/src/lib/view/modes/EditButton.tsx @@ -15,7 +15,7 @@ */ import React from 'react' -import { ModeRegistration, i18n } from '@kui-shell/core' +import { Arguments, ModeRegistration, i18n } from '@kui-shell/core' import Icons from '@kui-shell/plugin-client-common/mdist/components/spi/Icons' import { KubeResource, isCrudableKubeResource } from '../../model/resource' @@ -52,13 +52,14 @@ const yamlMode: ModeRegistration = { inPlace: true, kind: 'drilldown' as const, - command: async (_, resource: KubeResource, args: { argvNoOptions: string[] }) => { - const [{ fqnOf }, { getCommandFromArgs }] = await Promise.all([ + command: async (_, resource: KubeResource, args: Pick) => { + const [{ fqnOf }, { withKubeconfigFrom }, { getCommandFromArgs }] = await Promise.all([ import('../../../controller/kubectl/fqn'), + import('../../../controller/kubectl/options'), import('../../util/util') ]) - return `${getCommandFromArgs(args)} edit ${fqnOf(resource)}` + return withKubeconfigFrom(args, `${getCommandFromArgs(args)} edit ${fqnOf(resource)}`) } } }