How to use @kui-shell/plugin-k8s - 2 common examples

To help you get started, we’ve selected a few @kui-shell/plugin-k8s examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github IBM / kui / plugins / plugin-k8s / src / lib / controller / kedit.ts View on Github external
const showResource = async (yaml: KubeResource, filepath: string, tab: Tab) => {
  debug('showing one resource', yaml)

  if (Capabilities.inBrowser()) {
    injectCSS({
      css: require('@kui-shell/plugin-k8s/web/css/main.css').toString(),
      key: 'kedit'
    })
  } else {
    const ourRoot = dirname(require.resolve('@kui-shell/plugin-k8s/package.json'))
    injectCSS(join(ourRoot, 'web/css/main.css'))
  }

  // override the type shown in the sidecar header to show the
  // resource kind
  const typeOverride = yaml.kind
  const nameOverride = (resource: KubeResource) => (resource.metadata && resource.metadata.name) || basename(filepath)

  // add our mode buttons
  const resource = {
    kind: yaml.kind,
    filepathForDrilldown: filepath,
github IBM / kui / plugins / plugin-k8s / src / lib / controller / kedit.ts View on Github external
const showResource = async (yaml, filepath: string, tab: ITab, parsedOptions: ParsedOptions, execOptions: IExecOptions) => {
  debug('showing one resource', yaml)

  if (inBrowser()) {
    injectCSS({ css: require('@kui-shell/plugin-k8s/web/css/main.css').toString(), key: 'kedit' })
  } else {
    const ourRoot = dirname(require.resolve('@kui-shell/plugin-k8s/package.json'))
    injectCSS(join(ourRoot, 'web/css/main.css'))
  }

  // override the type shown in the sidecar header to show the
  // resource kind
  const typeOverride = yaml.kind
  const nameOverride = (resource: IKubeResource) => (resource.metadata && resource.metadata.name) || basename(filepath)

  // add our mode buttons
  const resource = { kind: yaml.kind, filepathForDrilldown: filepath, yaml }
  const addModeButtons = (defaultMode: string) => response => {
    response['modes'] = (response['modes'] || []).concat([
      { mode: 'edit', direct: openAsForm },
      { mode: 'raw', direct: openInEditor },

@kui-shell/plugin-k8s

Kui plugin for kubernetes

Apache-2.0
Latest version published 5 years ago

Package Health Score

54 / 100
Full package analysis

Popular @kui-shell/plugin-k8s functions