exec

package
v0.0.21 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package exec is the KubectlClient that runs the kubectl binary through a CommandRunner.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client runs kubectl, optionally pinned to one kubeconfig context.

func New

func New(runner interfaces.CommandRunner, kubeContext string) *Client

New returns the Client; kubeContext pins every call to that context when set. It does no I/O.

func (*Client) Apply

func (c *Client) Apply(ctx context.Context, ns string, files ...string) error

Apply runs `kubectl apply -f file…`; no files is CodeInvalidInput, as the contract says (kubectl would refuse it too).

func (*Client) CurrentContext

func (c *Client) CurrentContext(ctx context.Context) (string, error)

CurrentContext runs `kubectl config current-context`.

func (*Client) Get

func (c *Client) Get(ctx context.Context, ns, kind, name string) ([]byte, error)

Get runs `kubectl get kind [name] -o json`.

func (*Client) Rollout

func (c *Client) Rollout(
	ctx context.Context,
	ns, kind, name string,
	timeout time.Duration,
) error

Rollout runs `kubectl rollout status kind/name --timeout=…`.

Jump to

Keyboard shortcuts

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