diff --git a/plugins/plugin-kubectl/logs/src/controller/kubectl/logs.ts b/plugins/plugin-kubectl/logs/src/controller/kubectl/logs.ts index 24eedd5db7e..b6d735538a2 100644 --- a/plugins/plugin-kubectl/logs/src/controller/kubectl/logs.ts +++ b/plugins/plugin-kubectl/logs/src/controller/kubectl/logs.ts @@ -93,7 +93,7 @@ function decorateLogLines(lines: string): string { * some ANSI control codes for coloring. * */ -async function doLogs(args: Arguments) { +export async function doLogs(args: Arguments) { if (isUsage(args)) { // special case: get --help/-h return doHelp('kubectl', args) diff --git a/plugins/plugin-kubectl/logs/src/index.ts b/plugins/plugin-kubectl/logs/src/index.ts index faf8653dd41..6c9fc32786d 100644 --- a/plugins/plugin-kubectl/logs/src/index.ts +++ b/plugins/plugin-kubectl/logs/src/index.ts @@ -15,3 +15,4 @@ */ // this file defines the external API +export { doLogs } from './controller/kubectl/logs' diff --git a/plugins/plugin-kubectl/oc/src/controller/kubectl/delegates.ts b/plugins/plugin-kubectl/oc/src/controller/kubectl/delegates.ts index a366c026000..c9eeaee8607 100644 --- a/plugins/plugin-kubectl/oc/src/controller/kubectl/delegates.ts +++ b/plugins/plugin-kubectl/oc/src/controller/kubectl/delegates.ts @@ -26,6 +26,7 @@ import { doEdit, doRun } from '@kui-shell/plugin-kubectl' +import { doLogs } from '@kui-shell/plugin-kubectl/logs' const command = 'oc' @@ -34,6 +35,7 @@ export default (registrar: Registrar) => { registrar.listen(`/${commandPrefix}/${command}/create`, doCreate('create', command), crudFlags) registrar.listen(`/${commandPrefix}/${command}/delete`, doDelete(command), crudFlags) registrar.listen(`/${commandPrefix}/${command}/edit`, doEdit(command), defaultFlags) + registrar.listen(`/${commandPrefix}/${command}/logs`, doLogs, defaultFlags) registrar.listen(`/${commandPrefix}/${command}/run`, doRun(command), crudFlags) getter(registrar, command) diff --git a/plugins/plugin-kubectl/src/lib/view/modes/containers.ts b/plugins/plugin-kubectl/src/lib/view/modes/containers.ts index 98dfb0c0e4d..38e2963dbe5 100644 --- a/plugins/plugin-kubectl/src/lib/view/modes/containers.ts +++ b/plugins/plugin-kubectl/src/lib/view/modes/containers.ts @@ -59,7 +59,7 @@ const showLogs = (tab: Tab, { pod, container }, args: { argvNoOptions: string[] const containerName = encodeComponent(container.name) const ns = encodeComponent(pod.metadata.namespace) - return `${getCommandFromArgs(args)} logs ${podName} ${containerName} -n ${ns}` + return `${getCommandFromArgs(args)} logs ${podName} -c ${containerName} -n ${ns}` } /**