From 49e67e8bb412777faf8e182d4013b8fc6568c298 Mon Sep 17 00:00:00 2001 From: Nick Mitchell Date: Sat, 3 Sep 2022 14:57:54 -0400 Subject: [PATCH] fix(plugins/plugin-kubectl): delete button does not pass through --kubeconfig --- plugins/plugin-kubectl/src/lib/view/modes/DeleteButton.tsx | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plugins/plugin-kubectl/src/lib/view/modes/DeleteButton.tsx b/plugins/plugin-kubectl/src/lib/view/modes/DeleteButton.tsx index b509e9f0a48..b3e28bf18b2 100644 --- a/plugins/plugin-kubectl/src/lib/view/modes/DeleteButton.tsx +++ b/plugins/plugin-kubectl/src/lib/view/modes/DeleteButton.tsx @@ -15,18 +15,19 @@ */ import React from 'react' -import { i18n, Tab } from '@kui-shell/core' +import { i18n, Tab, ParsedOptions } from '@kui-shell/core' import { Icons } from '@kui-shell/plugin-client-common' import { KubeResource, isCrudableKubeResource as when } from '../../model/resource' import { fqnOf } from '../../../controller/kubectl/fqn' import { getCommandFromArgs } from '../../../lib/util/util' +import { withKubeconfigFrom } from '../../../controller/kubectl/options' const strings = i18n('plugin-kubectl') /** Formulate the delete command line */ -function command(tab: Tab, resource: KubeResource, args: { argvNoOptions: string[] }) { - return `${getCommandFromArgs(args)} delete ${fqnOf(resource)}` +function command(tab: Tab, resource: KubeResource, args: { argvNoOptions: string[]; parsedOptions: ParsedOptions }) { + return withKubeconfigFrom(args, `${getCommandFromArgs(args)} delete ${fqnOf(resource)}`) } /** The Delete button mode */