kube

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 5 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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