Documentation
¶
Overview ¶
Package kubectl provides helpers for running kubectl commands with the correct KUBECONFIG environment variable set. It centralises the pattern that was previously duplicated across network, x402, model, agent, and cmd/obol packages.
Index ¶
- func Apply(binary, kubeconfig string, data []byte) error
- func ApplyOutput(binary, kubeconfig string, data []byte) (string, error)
- func EnsureCluster(cfg *config.Config) error
- func Output(binary, kubeconfig string, args ...string) (string, error)
- func Paths(cfg *config.Config) (binary, kubeconfig string)
- func PipeCommands(binary, kubeconfig string, args1, args2 []string) error
- func Run(binary, kubeconfig string, args ...string) error
- func RunSilent(binary, kubeconfig string, args ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyOutput ¶ added in v0.8.0
ApplyOutput pipes the given data into kubectl apply -f - and returns stdout.
func EnsureCluster ¶
EnsureCluster checks that the kubeconfig file exists, returning a descriptive error when the cluster is not running.
func Output ¶
Output executes kubectl and returns the captured stdout. Stderr is captured and included in the returned error on failure.
func PipeCommands ¶ added in v0.8.0
PipeCommands pipes the stdout of the first kubectl command into the stdin of the second. Both commands run with the correct KUBECONFIG. This is useful for patterns like "kubectl create --dry-run -o yaml | kubectl replace -f -" which avoid the 262KB annotation limit that kubectl apply imposes.
Types ¶
This section is empty.