cmd

package
v0.0.0-...-39adbd8 Latest Latest
Warning

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

Go to latest
Published: May 24, 2026 License: MIT Imports: 79 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CodeSuccess indicates the command completed successfully.
	CodeSuccess = 0
	// CodeGeneralError indicates an unspecified error.
	CodeGeneralError = 1
	// CodeConnectionError indicates a failure connecting to one or more clusters.
	CodeConnectionError = 2
	// CodeNoContexts indicates no kubeconfig contexts were resolved.
	CodeNoContexts = 3
	// CodeNoDB indicates the --db flag was required but not provided.
	CodeNoDB = 4
	// CodeStoreError indicates a database storage failure.
	CodeStoreError = 5
)

Variables

View Source
var (
	// ErrNoContexts indicates no kubeconfig contexts were found or specified.
	ErrNoContexts = errors.New("no kubeconfig contexts specified")
	// ErrNoClients indicates all cluster connections failed.
	ErrNoClients = errors.New("no clusters reachable")
	// ErrNoDatabase indicates the --db flag is required but was not provided.
	ErrNoDatabase = errors.New("--db is required for this command")
)

Functions

func Execute

func Execute()

Execute runs the root command with a signal-cancellable context. SIGINT and SIGTERM both trigger graceful shutdown so containerized deployments behave correctly under Kubernetes pod termination. OpenTelemetry tracing is initialized here when an OTLP endpoint is configured; it is a no-op otherwise.

Types

type CheckResult

type CheckResult struct {
	// Name is the human-readable check identifier.
	Name string `json:"name"`
	// Status is the per-check status.
	Status Status `json:"status"`
	// Detail is a human-readable explanation.
	Detail string `json:"detail,omitempty"`
	// DurationMS is how long the check took.
	DurationMS int64 `json:"duration_ms"`
}

CheckResult is one check's outcome.

type Report

type Report struct {
	// Generated is when the report ran.
	Generated time.Time `json:"generated"`
	// Checks are the individual check outcomes.
	Checks []CheckResult `json:"checks"`
	// Summary tallies the per-status counts.
	Summary map[Status]int `json:"summary"`
}

Report aggregates all the checks for serialised output.

type Status

type Status string

Status enumerates the per-check outcomes the doctor reports.

const (
	// StatusOK indicates the check passed.
	StatusOK Status = "ok"
	// StatusWarn indicates a non-fatal concern.
	StatusWarn Status = "warn"
	// StatusFail indicates a definitive failure.
	StatusFail Status = "fail"
	// StatusSkip indicates the check did not apply (missing input).
	StatusSkip Status = "skip"
)

Doctor status constants. "warn" allows a check to flag a concern that is not a hard failure (for example, the controller CRD is absent because the user hasn't enabled the operator yet).

Jump to

Keyboard shortcuts

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