Skip to content

Latest commit

 

History

History
1828 lines (1087 loc) · 68.1 KB

kui_shell_plugin_kubectl.md

File metadata and controls

1828 lines (1087 loc) · 68.1 KB

Kui API Documentation - v11.0.0 / @kui-shell/plugin-kubectl

Module: @kui-shell/plugin-kubectl

Table of contents

Enumerations

Interfaces

Type aliases

Properties

Variables

Functions

Type aliases

Deployment

Ƭ Deployment: Deployment1 | Deployment2

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:421


KubePartial

Ƭ KubePartial<R>: Omit<R, "apiVersion" | "kind">

Type parameters

Name Type
R extends KubeResource = KubeResource

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:544


KubeResource

Ƭ KubeResource<Status, Metadata>: ResourceWithMetadata & WithRawData & { apiVersion: string ; isKubeResource: true ; isSimulacrum?: boolean ; kind: string ; metadata?: Metadata ; originatingCommand: Arguments<KubeOptions> ; spec?: any ; status?: Status }

The basic Kubernetes resource

Type parameters

Name Type
Status KubeStatus
Metadata KubeMetadata

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:194


KubeResourceWithSummary

Ƭ KubeResourceWithSummary<Status>: KubeResource<Status> & WithSummary

KubeResourceWithSummary allows plugins to provide their own Summary. Otherwise lib/views/modes/summary will try to fetch one automatically.

Type parameters

Name Type
Status KubeStatus

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:238

Properties

apiVersion

apiVersion: "github.com/kui-shell/plugin-kubectl/v1alpha1"


kubectl

kubectl: string


logsMode

logsMode: "logs"

Variables

Parser

Parser: Object

memory and cpu parsing

Type declaration

Name Type
cpuFraction (str: string) => number
cpuShare (str: string) => number
formatAsBytes (mem: number) => string
formatAsCpu (cpu: number) => string
fractionOfMemory (num: string, denom: string) => string
memShare (str: string) => number
reformatAsBytes (mem: string) => string

Defined in

plugins/plugin-kubectl/src/lib/util/parse.ts:144


defaultFlags

defaultFlags: CommandOptions

Defined in

plugins/plugin-kubectl/src/controller/kubectl/flags.ts:66

Functions

computeDurations

computeDurations<T>(table): T

Turn START and END columns into a DURATION column.

TODO Kubectl gurus: Is there a way to get this directly from a jsonpath or go-template? I think so from the latter?

Type parameters

Name Type
T extends Table<Row> | KResponse<any>

Parameters

Name Type
table T

Returns

T

Defined in

plugins/plugin-kubectl/src/lib/view/formatTable.ts:515


describer

describer(registrar, command, cli?): void

Register a command listener

Parameters

Name Type Default value
registrar CommandRegistrar undefined
command string undefined
cli string command

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/describe.ts:48


doCreate

Const doCreate(verb, command?): (args: EvaluatorArgs<KubeOptions>) => Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Parameters

Name Type Default value
verb "create" | "apply" undefined
command string 'kubectl'

Returns

fn

▸ (args): Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Parameters
Name Type
args EvaluatorArgs<KubeOptions>
Returns

Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/create.ts:34


doDelete

Const doDelete(command?): (args: EvaluatorArgs<KubeOptions>) => Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Parameters

Name Type Default value
command string 'kubectl'

Returns

fn

▸ (args): Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Parameters
Name Type
args EvaluatorArgs<KubeOptions>
Returns

Promise<string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[]>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/delete.ts:41


doExecRaw

doExecRaw(command, parsedOptions, execOptions): Promise<string>

A convenience wrapper over doNativeExec that extracts only stdout, and discards the exit code and stderr.

Parameters

Name Type
command string
parsedOptions KubeOptions
execOptions ExecOptions

Returns

Promise<string>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/raw.ts:165


doExecWithMarkdown

doExecWithMarkdown(args, exec?): Promise<NavResponse>

Parameters

Name Type
args EvaluatorArgs<KubeOptions>
exec? string

Returns

Promise<NavResponse>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec-to-markdown.ts:24


doExecWithPty

doExecWithPty<Content, Response, O>(args, prepare?, exec?): Promise<string | Response>

Execute the given command using a pty

Type parameters

Name Type
Content void
Response extends KResponse<Content> = KResponse<Content>
O extends KubeOptions = KubeOptions

Parameters

Name Type Default value
args EvaluatorArgs<O> undefined
prepare Prepare<O> NoPrepare
exec? string undefined

Returns

Promise<string | Response>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:108


doExecWithRadioTable

doExecWithRadioTable<Resource>(resources, defaultSelectedIdx, onSelect, __namedParameters?): Promise<RadioTable | void>

Type parameters

Name Type
Resource extends MetadataBearing<void, Resource> & WithRawData<void, Resource> & { apiVersion: string ; isKubeResource: true ; isSimulacrum?: boolean ; kind: string ; metadata?: KubeMetadata ; originatingCommand: EvaluatorArgs<KubeOptions> ; spec?: any ; status?: KubeStatus }

Parameters

Name Type
resources Resource[]
defaultSelectedIdx number
onSelect (name: string, resource: Resource) => string
__namedParameters Object
__namedParameters.nameColumnTitle string
__namedParameters.title string

Returns

Promise<RadioTable | void>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:283


doExecWithStatus

Const doExecWithStatus<O>(verb, finalState, command?, prepareForExec?, prepareForStatus?): (args: EvaluatorArgs<O>) => Promise<KubeTableResponse>

Execute a command, and then execute the status command which will poll until the given FinalState is reached.

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type Default value
verb string undefined
finalState FinalState undefined
command string 'kubectl'
prepareForExec Prepare<O> NoPrepare
prepareForStatus PrepareForStatus<O> DefaultPrepareForStatus

Returns

fn

▸ (args): Promise<KubeTableResponse>

Parameters
Name Type
args EvaluatorArgs<O>
Returns

Promise<KubeTableResponse>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:260


doExecWithStdout

doExecWithStdout<O>(args, prepare?, exec?): Promise<string>

Behaves as does exec, except that it projects out just the stdout part -- thus ignoring the exit code and stderr.

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type Default value
args EvaluatorArgs<O> undefined
prepare Prepare<O> NoPrepare
exec? string undefined

Returns

Promise<string>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:85


doExecWithStdoutViaPty

doExecWithStdoutViaPty<O>(args, prepare?): Promise<string>

Execute the given command using a pty, but return a string

Type parameters

Name Type
O extends KubeOptions = KubeOptions

Parameters

Name Type Default value
args EvaluatorArgs<O> undefined
prepare Prepare<O> NoPrepare

Returns

Promise<string>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:159


doExecWithTable

doExecWithTable<O>(args, prepare?, command?, __namedParameters?): Promise<Table | MixedResponse>

Behaves as does exec, except that it projects out just the stdout part and parses it into a Table model.

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type Default value
args EvaluatorArgs<O> undefined
prepare Prepare<O> NoPrepare
command string 'kubectl'
__namedParameters Object {}
__namedParameters.entityType? string undefined
__namedParameters.nameColumn? string undefined
__namedParameters.usePty? boolean undefined
__namedParameters.verb? string undefined

Returns

Promise<Table | MixedResponse>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/exec.ts:224


doGet

Const doGet(command): (args: EvaluatorArgs<KubeOptions>) => Promise<KResponse<any>>

This is the main handler for kubectl get. Here, we act as a dispatcher: in kubectl a get can mean either get-as-table, get-as-entity, or get-as-custom, depending on the -o flag.

Parameters

Name Type
command string

Returns

fn

▸ (args): Promise<KResponse<any>>

Parameters
Name Type
args EvaluatorArgs<KubeOptions>
Returns

Promise<KResponse<any>>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/get.ts:331


doHelp

doHelp<O>(command, args, prepare?): Promise<KResponse>

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type Default value
command string undefined
args EvaluatorArgs<O> undefined
prepare Prepare<O> NoPrepare

Returns

Promise<KResponse>

Defined in

plugins/plugin-kubectl/src/lib/util/help.ts:467


doNativeExec

doNativeExec(args): Promise<RawResponse>

Parameters

Name Type
args Args

Returns

Promise<RawResponse>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/raw.ts:136


doRun

Const doRun(command?): (args: EvaluatorArgs<KubeOptions>) => Promise<KResponse<any>>

Parameters

Name Type Default value
command string 'kubectl'

Returns

fn

▸ (args): Promise<KResponse<any>>

Parameters
Name Type
args EvaluatorArgs<KubeOptions>
Returns

Promise<KResponse<any>>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/run.ts:40


emitKubectlConfigChangeEvent

emitKubectlConfigChangeEvent(type, namespace?, context?): void

Parameters

Name Type
type "SetNamespaceOrContext" | "CreateOrDeleteNamespace"
namespace? string
context? string

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/config.ts:39


fetchFileString

fetchFileString(args, url, headers?): Promise<(void | string)[]>

same as fetchFile, but returning a string rather than a Buffer

Parameters

Name Type
args ContextArgs
url string
headers? Record<string, string>

Returns

Promise<(void | string)[]>

Defined in

plugins/plugin-kubectl/src/lib/util/fetch-file.ts:292


flags

flags(booleans?): CommandOptions

Parameters

Name Type Default value
booleans string[] []

Returns

CommandOptions

Defined in

plugins/plugin-kubectl/src/controller/kubectl/flags.ts:44


formatTable

Const formatTable<O>(command, verb, entityTypeFromCommandLine, args, preTable, nameColumn?): Promise<Table<Row>>

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type Default value
command string undefined
verb string undefined
entityTypeFromCommandLine string undefined
args EvaluatorArgs<O> undefined
preTable Pair[][] undefined
nameColumn string 'NAME'

Returns

Promise<Table<Row>>

Defined in

plugins/plugin-kubectl/src/lib/view/formatTable.ts:212


fqn

fqn(apiVersion, kind, name, namespace): string

Parameters

Name Type
apiVersion string
kind string
name string
namespace string

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/fqn.ts:93


fqnOf

fqnOf(resource): string

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/fqn.ts:101


getAllContexts

getAllContexts(__namedParameters): Promise<KubeContext[]>

Parameters

Name Type
__namedParameters Object
__namedParameters.REPL default

Returns

Promise<KubeContext[]>

a list of KubeContext for all known contexts

Defined in

plugins/plugin-kubectl/src/controller/kubectl/contexts.ts:68


getAsMMRTransformer

getAsMMRTransformer(args, resource): Promise<MultiModalResponse<KubeResource>>

kubectl get as entity response

Parameters

Name Type
args EvaluatorArgs<KubeOptions>
resource KubeResource<KubeStatus, KubeMetadata>

Returns

Promise<MultiModalResponse<KubeResource>>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/get.ts:183


getCommandFromArgs

Const getCommandFromArgs(args): string

Parameters

Name Type
args Pick<EvaluatorArgs<ParsedOptions>, "argvNoOptions">

Returns

string

Defined in

plugins/plugin-kubectl/src/lib/util/util.ts:115


getContainer

getContainer(args, verb): string

e.g. for kubectl logs

Parameters

Name Type
args EvaluatorArgs<KubeOptions>
verb string

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:229


getCurrentContext

getCurrentContext(__namedParameters): Promise<KubeContext>

Parameters

Name Type
__namedParameters Object
__namedParameters.REPL default

Returns

Promise<KubeContext>

a KubeContext representing the current context

Defined in

plugins/plugin-kubectl/src/controller/kubectl/contexts.ts:56


getCurrentContextName

getCurrentContextName(__namedParameters): Promise<string>

Parameters

Name Type
__namedParameters Object
__namedParameters.REPL default

Returns

Promise<string>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/contexts.ts:72


getCurrentDefaultContextName

getCurrentDefaultContextName(__namedParameters): string | Promise<string>

Parameters

Name Type
__namedParameters ContextArgs

Returns

string | Promise<string>

the relevant context for the given args/command line

Defined in

plugins/plugin-kubectl/src/controller/kubectl/contexts.ts:105


getCurrentDefaultNamespace

getCurrentDefaultNamespace(args): Promise<string>

Parameters

Name Type
args ContextArgs

Returns

Promise<string>

the relevant namespace for the given args/command line

Defined in

plugins/plugin-kubectl/src/controller/kubectl/contexts.ts:128


getKind

getKind(command, args, kindAsProvidedByUser): Promise<string>

Parameters

Name Type Description
command string -
args EvaluatorArgs<ParsedOptions> -
kindAsProvidedByUser string e.g. pod or po

Returns

Promise<string>

e.g. Pod

Defined in

plugins/plugin-kubectl/src/controller/kubectl/explain.ts:329


getLabel

getLabel(__namedParameters): string

Parameters

Name Type
__namedParameters Pick<EvaluatorArgs<KubeOptions>, "parsedOptions">

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:144


getLabelForArgv

getLabelForArgv(args): string

Parameters

Name Type
args EvaluatorArgs<KubeOptions>

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:169


getNamespace

getNamespace(args): Promise<string>

Parameters

Name Type
args EvaluatorArgs<KubeOptions>

Returns

Promise<string>

the namespace as expressed in the command line, or the default from context

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:206


getNamespaceForArgv

getNamespaceForArgv(args): string

A variant of getNamespace where you only want to use what was provided by the user in their command line.

Parameters

Name Type
args Pick<EvaluatorArgs<KubeOptions>, "parsedOptions">

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:214


getPodsCommand

getPodsCommand(resource, args?): string

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>
args? Pick<EvaluatorArgs<ParsedOptions>, "argvNoOptions">

Returns

string

Defined in

plugins/plugin-kubectl/src/lib/view/modes/pods.ts:25


getTabState

getTabState(tab, key): any

Parameters

Name Type
tab default
key string

Returns

any

Defined in

plugins/plugin-kubectl/src/tab-state.ts:27


getTransformer

getTransformer(args, response): Promise<ReturnType<typeof getAsMMRTransformer> | Table>

KubeResource -> MultiModalResponse view transformer

Parameters

Name Type
args EvaluatorArgs<KubeOptions>
response KResponse<any>

Returns

Promise<ReturnType<typeof getAsMMRTransformer> | Table>

Defined in

plugins/plugin-kubectl/src/controller/kubectl/get.ts:402


getter

getter(registrar, command, cli?): void

Register a command listener

Parameters

Name Type Default value
registrar CommandRegistrar undefined
command string undefined
cli string command

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/get.ts:465


hasLabel

hasLabel(args): boolean

Due to deficiencies in yargs-parser (used by @kui-shell/core), the form -lapp=name (i.e. without a whitespace after the -l) is not parsed properly.

Parameters

Name Type
args EvaluatorArgs<KubeOptions>

Returns

boolean

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:183


isCrudableKubeResource

isCrudableKubeResource(entity): entity is KubeResource<KubeStatus, KubeMetadata>

is the command response a kube resource that can responds to "kubectl delete", etc.?

Parameters

Name Type
entity MetadataBearing<void>

Returns

entity is KubeResource<KubeStatus, KubeMetadata>

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:530


isDeployment

isDeployment(resource): resource is Deployment

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

resource is Deployment

whether the given resource is an instance of a Deployment

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:427


isForAllNamespaces

isForAllNamespaces(parsedOptions): boolean

Parameters

Name Type
parsedOptions KubeOptions

Returns

boolean

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:317


isHelpRequest

isHelpRequest(args): boolean

Parameters

Name Type
args EvaluatorArgs<KubeOptions>

Returns

boolean

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:112


isJob

isJob(resource): resource is Job

Parameters

Name Type
resource Pick<KubeResource<KubeStatus, KubeMetadata>, "apiVersion" | "kind">

Returns

resource is Job

whether the given resource is an instance of a Deploymemt

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:399


isKubeItems

isKubeItems(resource): resource is KubeItems<KubeResource<KubeStatus, KubeMetadata>>

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

resource is KubeItems<KubeResource<KubeStatus, KubeMetadata>>

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:552


isKubeItemsOfKind

isKubeItemsOfKind<Item>(resource, isOfKind): resource is KubeItems<Item>

Type parameters

Name Type
Item extends MetadataBearing<void, Item> & WithRawData<void, Item> & { apiVersion: string ; isKubeResource: true ; isSimulacrum?: boolean ; kind: string ; metadata?: KubeMetadata ; originatingCommand: EvaluatorArgs<KubeOptions> ; spec?: any ; status?: KubeStatus } = KubeResource<KubeStatus, KubeMetadata>

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>
isOfKind (item: KubeResource<KubeStatus, KubeMetadata>) => item is Item

Returns

resource is KubeItems<Item>

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:560


isKubeResource

isKubeResource(entity): entity is KubeResource<KubeStatus, KubeMetadata>

is the command response a Kubernetes resource? note: excluding any ones we simulate in kubeui

Parameters

Name Type
entity MetadataBearing<void> | KResponse<any>

Returns

entity is KubeResource<KubeStatus, KubeMetadata>

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:214


isPod

isPod(resource): resource is Pod

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

resource is Pod

whether the given resource is an instance of a Pod

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:335


isPodList

isPodList(resource): resource is PodList

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

resource is PodList

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:556


isSecret

isSecret(resource): resource is Secret<Record<string, any>>

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

resource is Secret<Record<string, any>>

Defined in

plugins/plugin-kubectl/src/lib/model/resource.ts:760


isTableRequest

isTableRequest(args): boolean

Parameters

Name Type
args Pick<EvaluatorArgs<KubeOptions>, "parsedOptions">

Returns

boolean

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:118


isUsage

Const isUsage(args): boolean

Parameters

Name Type
args EvaluatorArgs<KubeOptions>

Returns

boolean

Defined in

plugins/plugin-kubectl/src/lib/util/help.ts:465


isWatchRequest

isWatchRequest(args): boolean

Parameters

Name Type
args Pick<EvaluatorArgs<KubeOptions>, "parsedOptions">

Returns

boolean

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:122


offKubectlConfigChangeEvents

offKubectlConfigChangeEvents(handler): void

Parameters

Name Type
handler Handler

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/config.ts:55


onKubectlConfigChangeEvents

onKubectlConfigChangeEvents(handler): void

Parameters

Name Type
handler Handler

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/config.ts:51


parseName

parseName(resource): { app: string ; name: string ; nameHash: string ; version: string } | { app: undefined ; name: string ; nameHash: string ; version: string } | { app: undefined ; name: undefined ; nameHash: undefined ; version: undefined }

Separate the app and generated parts of a resource name

Parameters

Name Type
resource KubeResource<KubeStatus, KubeMetadata>

Returns

{ app: string ; name: string ; nameHash: string ; version: string } | { app: undefined ; name: string ; nameHash: string ; version: string } | { app: undefined ; name: undefined ; nameHash: undefined ; version: undefined }

Defined in

plugins/plugin-kubectl/src/lib/util/name.ts:23


preprocessTable

Const preprocessTable(raw): Pair[][][]

Find the column splits

Parameters

Name Type
raw string[]

Returns

Pair[][][]

Defined in

plugins/plugin-kubectl/src/lib/view/formatTable.ts:147


registerApplySubcommands

registerApplySubcommands(registrar, cmd): void

Parameters

Name Type
registrar CommandRegistrar
cmd string

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/apply-subcommands.ts:108


registerConfig

registerConfig(registrar, cmd): void

Parameters

Name Type
registrar CommandRegistrar
cmd string

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/config.ts:101


registerEdit

registerEdit(registrar, cmd): void

Parameters

Name Type
registrar CommandRegistrar
cmd string

Returns

void

Defined in

plugins/plugin-kubectl/src/controller/kubectl/edit.ts:279


stringToTable

Const stringToTable<O>(decodedResult, stderr, args, command?, verb?, entityType?, nameColumn?): Promise<KubeTableResponse>

Display the given string as a REPL table

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type
decodedResult string
stderr string
args EvaluatorArgs<O>
command? string
verb? string
entityType? string
nameColumn? string

Returns

Promise<KubeTableResponse>

Defined in

plugins/plugin-kubectl/src/lib/view/formatTable.ts:461


watchRequestFrom

watchRequestFrom(args, forceWatch?): "" | "--watch" | "-w" | "--watch-only"

Parameters

Name Type Default value
args EvaluatorArgs<KubeOptions> undefined
forceWatch boolean false

Returns

"" | "--watch" | "-w" | "--watch-only"

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:126


withHelp

withHelp<O>(args): string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> & Partial<WithSourceReferences> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[] | Promise<KResponse<any>>

Wrap the given command handler this with a help dispatcher.

Type parameters

Name Type
O extends KubeOptions

Parameters

Name Type
args EvaluatorArgs<O>

Returns

string | number | boolean | HTMLElement | Error | MarkdownResponse | ReactResponse | MixedResponse | CommentaryResponse | TabLayoutModificationResponse<NewSplitRequest> | XtermResponse | RandomErrorResponse1 | RandomErrorResponse2 | Table<Row> & Partial<WithSourceReferences> | AbortableResponse<ScalarResponse<Row>> | NavResponse | RadioTable | UsageModel | MetadataBearing<any> | RawResponse<any> | MetadataBearing<any>[] | Promise<KResponse<any>>

Defined in

plugins/plugin-kubectl/src/lib/util/help.ts:487


withKubeconfigFrom

withKubeconfigFrom(args, cmdline): string

Copy over any kubeconfig/context/cluster/namespace specifications from the given args

Parameters

Name Type
args Pick<EvaluatorArgs<KubeOptions>, "parsedOptions">
cmdline string

Returns

string

Defined in

plugins/plugin-kubectl/src/controller/kubectl/options.ts:322


withNamespaceBreadcrumb

withNamespaceBreadcrumb(ns, table): MixedResponse | Table<Row>

Change the namespace breadcrumb of the given maybe-Table

Parameters

Name Type
ns string
table MixedResponse | Table<Row>

Returns

MixedResponse | Table<Row>

Defined in

plugins/plugin-kubectl/src/lib/view/formatTable.ts:604