doctor

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package doctor implements cluster readiness diagnostics for the cluster CLI.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PrintDoctorReport

func PrintDoctorReport(r DoctorReport)

PrintDoctorReport emits a human-readable report using the standard printer.

Types

type Distribution

type Distribution string

Distribution identifies a Kubernetes flavor for remediation messaging.

const (
	DistroK3s           Distribution = "k3s"
	DistroKind          Distribution = "kind"
	DistroMinikube      Distribution = "minikube"
	DistroDockerDesktop Distribution = "docker-desktop"
	DistroGeneric       Distribution = "generic"
)

func DetectDistribution

func DetectDistribution(kubectl core.KubectlRunner) Distribution

DetectDistribution inspects node info to guess which distribution is running. This is best-effort: callers should treat DistroGeneric as "probably kubeadm/unknown".

type DoctorCheck

type DoctorCheck struct {
	Name   string
	OK     bool
	Detail string
	Remedy string // Short hint; detailed steps come from the distro checklist.
}

DoctorCheck is a single preflight check result.

type DoctorCheckProgress

type DoctorCheckProgress func(DoctorCheckProgressEvent) func(DoctorCheck)

DoctorCheckProgress is called before each doctor check starts. It returns an optional completion callback that receives the finished check result.

type DoctorCheckProgressEvent

type DoctorCheckProgressEvent struct {
	Name   string
	Detail string
	Index  int
	Total  int
}

DoctorCheckProgressEvent describes the check that is about to run.

type DoctorReport

type DoctorReport struct {
	Distribution Distribution
	Checks       []DoctorCheck
}

DoctorReport aggregates the full preflight result.

func RunDoctor

func RunDoctor(kubectl core.KubectlRunner) DoctorReport

RunDoctor executes cluster diagnostics and returns a report.

func RunDoctorAndPrint

func RunDoctorAndPrint(kubectl core.KubectlRunner) DoctorReport

RunDoctorAndPrint streams doctor progress and results as checks execute.

func RunDoctorWithProgress

func RunDoctorWithProgress(kubectl core.KubectlRunner, progress DoctorCheckProgress) DoctorReport

RunDoctorWithProgress executes cluster diagnostics and calls progress hooks before and after each check. It is useful for UIs that need live feedback.

func RunPostSetupSmoke

func RunPostSetupSmoke(kubectl core.KubectlRunner) DoctorReport

RunPostSetupSmoke executes a short post-setup operational gate for installed MCP Runtime clusters. It covers basic login-path and dependency readiness, not the full `cluster diagnostics` suite.

func RunPostSetupSmokeAndPrint

func RunPostSetupSmokeAndPrint(kubectl core.KubectlRunner) DoctorReport

RunPostSetupSmokeAndPrint streams the post-setup operational smoke checks.

func RunSetupDoctor

func RunSetupDoctor(kubectl core.KubectlRunner) DoctorReport

RunSetupDoctor executes pre-setup readiness checks and returns a report.

func RunSetupDoctorAndPrint

func RunSetupDoctorAndPrint(kubectl core.KubectlRunner) DoctorReport

RunSetupDoctorAndPrint streams setup-preflight progress and results.

func RunSetupDoctorWithProgress

func RunSetupDoctorWithProgress(kubectl core.KubectlRunner, progress DoctorCheckProgress) DoctorReport

RunSetupDoctorWithProgress executes pre-setup readiness checks and calls progress hooks before and after each check.

func (DoctorReport) AllOK

func (r DoctorReport) AllOK() bool

AllOK reports whether every check passed.

Jump to

Keyboard shortcuts

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