kubectl

package
v1.13.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 16, 2024 License: MIT Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// PluginName is the name of the Helm Botkube plugin.
	PluginName = "kubectl"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type BinaryRunner

type BinaryRunner struct {
	// contains filtered or unexported fields
}

BinaryRunner runs a kubectl binary.

func NewBinaryRunner

func NewBinaryRunner() *BinaryRunner

NewBinaryRunner returns a new BinaryRunner instance.

func (*BinaryRunner) RunKubectlCommand

func (e *BinaryRunner) RunKubectlCommand(ctx context.Context, kubeConfigPath, defaultNamespace, cmd string) (string, error)

RunKubectlCommand runs a Kubectl CLI command and run output.

type Config

type Config struct {
	Log                config.Logger  `yaml:"log"`
	DefaultNamespace   string         `yaml:"defaultNamespace,omitempty"`
	InteractiveBuilder builder.Config `yaml:"interactiveBuilder,omitempty"`
}

Config holds Kubectl plugin configuration parameters.

func MergeConfigs

func MergeConfigs(configs []*executor.Config) (Config, error)

MergeConfigs merges the Kubectl configuration.

func (Config) Validate

func (c Config) Validate() error

type Executor

type Executor struct {
	// contains filtered or unexported fields
}

Executor provides functionality for running Helm CLI.

func NewExecutor

func NewExecutor(ver string, kcRunner kcRunner) *Executor

NewExecutor returns a new Executor instance.

func (*Executor) Execute

Execute returns a given command as response.

func (*Executor) Help

Help returns help message.

func (*Executor) Metadata

func (e *Executor) Metadata(context.Context) (api.MetadataOutput, error)

Metadata returns details about Kubectl plugin.

type KubeconfigScopedRunner added in v1.1.0

type KubeconfigScopedRunner struct {
	// contains filtered or unexported fields
}

KubeconfigScopedRunner is a runner that executes kubectl commands using a specific kubeconfig file.

func NewKubeconfigScopedRunner added in v1.1.0

func NewKubeconfigScopedRunner(underlying kcRunner, kubeconfigPath string) *KubeconfigScopedRunner

NewKubeconfigScopedRunner creates a new instance of KubeconfigScopedRunner.

func (*KubeconfigScopedRunner) RunKubectlCommand added in v1.1.0

func (k *KubeconfigScopedRunner) RunKubectlCommand(ctx context.Context, defaultNamespace, cmd string) (string, error)

RunKubectlCommand runs a kubectl CLI command scoped to configured kubeconfig.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL