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).
Source Files
¶
- cmd_apikey.go
- cmd_backup.go
- cmd_baseline.go
- cmd_compare.go
- cmd_diagnose.go
- cmd_doctor.go
- cmd_drift.go
- cmd_export.go
- cmd_group.go
- cmd_history.go
- cmd_init.go
- cmd_location.go
- cmd_migrate.go
- cmd_recommend.go
- cmd_remediate.go
- cmd_root.go
- cmd_scan.go
- cmd_serve.go
- cmd_tag.go
- cmd_textfile.go
- cmd_top.go
- cmd_verify.go
- cmd_watch.go
- cmd_whatchanged.go
- cmd_why.go
- codes.go
- config_file.go
- errors.go
- execute.go
- store.go
- version.go
Click to show internal directories.
Click to hide internal directories.