cli

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute(version string) int

Execute builds the CLI and runs it. It returns a process exit code.

Types

type Options

type Options struct {
	// Common options
	Namespace   string // default namespace for namespaceless manifests / releases
	KubeContext string // kubeconfig context to use
	Kubeconfig  string // path to kubeconfig file

	// Kubernetes client rate limit overrides (passed to client-go rest.Config).
	// If zero, client-go defaults / server-side limits apply; set >0 to override.
	KubeQPS   float32 // per-client QPS for Kubernetes client (0 means use client-go default)
	KubeBurst int     // burst for Kubernetes client (0 means use client-go default)

	Timeout               time.Duration // global tracking timeout
	FailureGracePeriod    time.Duration // grace period to retry builtin trackers after failure
	ProgressPrintInterval time.Duration // interval between progress table re-renders (0 means use runner default)

	IncludeKinds  []string // only track these kinds (repeatable)
	ExcludeKinds  []string // exclude these kinds (repeatable)
	CRDConditions []string // custom CRD readiness mappings as provided by CLI

	ShowEvents      bool // show Kubernetes events tables
	OnlyErrorsLogs  bool // only stream logs for failing containers
	Quiet           bool // suppress non-essential output
	Verbose         bool // enable verbose logging
	PrintSummary    bool // print summary before/after tracking
	ExitOnFirstFail bool // exit immediately on first resource failure

	// Track-specific options
	Files     []string // input manifest paths (files, dirs, '-' for stdin)
	Recursive bool     // recursively traverse directories when loading manifests
}

Options contains shared CLI flags and configuration used by kubetracker subcommands.

This type is intended to be the single source-of-truth for CLI-level options (global and per-subcommand). It is kept in its own file so the root command can remain focused on wiring while options/validation helpers live independently.

func (*Options) ApplyGlobal

func (o *Options) ApplyGlobal(global *Options)

ApplyGlobal merges values from a global options set into the receiver according to the CLI precedence rules (local overrides global for strings unless empty, booleans are combined sensibly).

func (*Options) EnsureFilesDefault

func (o *Options) EnsureFilesDefault()

EnsureFilesDefault sets a sensible default for Files when none were provided (kubetracker treats absence of file paths as reading from stdin).

func (*Options) Validate

func (o *Options) Validate() error

Validate performs basic validation of option values and returns a helpful error when values are invalid (caller can wrap or convert into CLI exit codes).

Jump to

Keyboard shortcuts

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