kube

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Sep 15, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package kube reads the local kubectl configuration. flow never mutates the user's kubeconfig: to target a different cluster it passes --kube-context to helm instead.

Index

Constants

This section is empty.

Variables

View Source
var ErrNoContext = fmt.Errorf("no current kube context is set")

ErrNoContext reports that kubectl has no current context selected.

Functions

This section is empty.

Types

type Kube

type Kube struct {
	Runner flowexec.Runner
	Bin    string
}

Kube wraps the kubectl binary.

func New

func New(r flowexec.Runner) *Kube

New returns a Kube for the kubectl binary.

func (*Kube) Available

func (k *Kube) Available() bool

Available reports whether kubectl is on PATH. The user's shell may alias kubectl to something else; os/exec ignores aliases, so this checks for a real binary.

func (*Kube) Contexts

func (k *Kube) Contexts(ctx context.Context) ([]string, error)

Contexts lists every configured context name.

func (*Kube) CurrentContext

func (k *Kube) CurrentContext(ctx context.Context) (string, error)

CurrentContext returns the active kube context name.

func (*Kube) Pods

func (k *Kube) Pods(ctx context.Context, contextName, namespace string) ([]Pod, error)

Pods returns a compact summary of the pods in a namespace.

func (*Kube) Reachable

func (k *Kube) Reachable(ctx context.Context, contextName string) error

Reachable reports whether the cluster answers, using a short-lived probe.

func (*Kube) ServerURL

func (k *Kube) ServerURL(ctx context.Context, contextName string) (string, error)

ServerURL returns the API server address for a context, for the confirmation header that names exactly which cluster is about to be changed.

type Pod

type Pod struct {
	Name       string
	Phase      string
	Ready      int
	Total      int
	Restarts   int
	NodeName   string
	Reason     string
	Terminated bool
}

Pod is the summary flow shows for a namespace.

func (Pod) Healthy

func (p Pod) Healthy() bool

Healthy reports a pod in a state that needs no attention.

Jump to

Keyboard shortcuts

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