Documentation
¶
Index ¶
- Constants
- Variables
- func FormatText(w io.Writer, report *Report) error
- func SummaryLine(report *Report) string
- func ValidateOnlySections(sections []string) error
- type AgentStatus
- type AgentStatusFetcher
- type Check
- type Options
- type RegisterScope
- type Report
- type SectionResult
- type Status
- type Verifier
Constants ¶
const ( // DefaultAPITimeout is how long checkKubernetes waits for the API to become reachable. DefaultAPITimeout = 10 * time.Second // APIPollInterval is the waitForAPI ticker interval. APIPollInterval = 1 * time.Second // DefaultDeploymentReplicas is the expected replica count when Spec.Replicas is nil. DefaultDeploymentReplicas int32 = 1 // Check display names (stable report identifiers, not Kubernetes object names). CheckNameScope = "scope" CheckNameAPI = "api" CheckNameNodes = "nodes" CheckNameNamespace = "namespace" CheckNameNamespaces = "namespaces" CheckNameCalicoNode = "calico-node" CheckNameHealth = "health" CheckNamePeer = "peer" CheckNameClient = "client" CheckNameProvisioned = "provisioned" CheckNameInboundPeering = "inbound-peering" CheckNameServiceStatus = "service-status" CheckNameRemoteNamespace = "remote-namespace" CheckNameHelmWorkloads = "helm-workloads" CheckNameHelmNamespace = "helm-namespace" CheckNameCRDs = "crds" CheckNameOperatorDeploy = "operator-deployment" CheckNameAlloy = "alloy" CheckNameExporter = "exporter" CheckNameVNCNamespace = "vnc-namespace" CheckNameVNCGateway = "vnc-gateway" CheckNameMimirSecret = "mimir-secret" )
Verify package defaults for timeouts and check names.
const ( SectionKubernetes = "kubernetes" SectionCalico = "calico" SectionLiqo = "liqo" SectionPeering = "peering" SectionOffloading = "offloading" SectionAgent = "agent" SectionOperator = "operator" )
Section identifiers used in reports and --section filtering.
Variables ¶
var AllSections = []string{ SectionKubernetes, SectionCalico, SectionLiqo, SectionPeering, SectionOffloading, SectionAgent, SectionOperator, }
AllSections is the ordered list of verify subsections.
Functions ¶
func FormatText ¶
FormatText writes a human-readable report to w.
func SummaryLine ¶
SummaryLine returns a one-line summary suitable for logs.
func ValidateOnlySections ¶
ValidateOnlySections returns an error if OnlySections contains unknown names.
Types ¶
type AgentStatus ¶
type AgentStatus struct {
Provisioned bool
InboundPeeringState string
InboundPeeringError string
ServiceStatus string
Name string
}
AgentStatus is the platform API view of an agent used by the agent section.
type AgentStatusFetcher ¶
type AgentStatusFetcher interface {
FetchAgentStatus(ctx context.Context, agentID string) (*AgentStatus, error)
}
AgentStatusFetcher loads agent status from the platform API.
type Check ¶
type Check struct {
Section string `json:"section"`
Name string `json:"name"`
Status Status `json:"status"`
Message string `json:"message"`
}
Check is one named assertion inside a section.
type Options ¶
type Options struct {
AgentID string
KubeconfigPath string
// OnlySections, when non-empty, restricts execution to these section names.
OnlySections []string
// ExpectOffloading requires NamespaceOffloading for OffloadNamespaces.
ExpectOffloading bool
OffloadNamespaces []string
// ExpectOperator requires hypervisor operator chart workloads and CRDs.
ExpectOperator bool
HypervisorDriver string
OperatorNamespace string // Helm install namespace (default: proxmox-system or virtfusion-system)
OperatorRelease string
VNCGatewayNamespace string
// ExpectOperatorRemoteNS requires the remote namespace reflected after inbound peering.
ExpectOperatorRemoteNS bool
OperatorRemoteNS string
// ExpectAgentAPI polls the platform API for provisioned / inbound peering status.
ExpectAgentAPI bool
}
Options controls which verify subsections run and what they expect. Built from `nr cluster register` flags so skipped phases are not required.
func OptionsFromRegister ¶
func OptionsFromRegister(scope RegisterScope) Options
OptionsFromRegister builds verify Options matching what register installed.
type RegisterScope ¶
type RegisterScope struct {
AgentID string
DisableOffloading bool
SkipOperatorInstall bool
HypervisorDriver string
OperatorNamespace string // optional extra namespace to offload (not the Helm namespace)
VNCGatewayNamespace string
OffloadNamespaces []string
}
RegisterScope captures the register-flag subset that affects verify.
type Report ¶
type Report struct {
AgentID string `json:"agent_id,omitempty"`
Sections []SectionResult `json:"sections"`
}
Report is the full provider-cluster verification result.
func (*Report) FailedCount ¶
FailedCount returns how many checks have StatusFail.
func (*Report) FlatChecks ¶
FlatChecks returns all checks in report order.
type SectionResult ¶
SectionResult groups checks under a subsection name.
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
Verifier runs provider-cluster health subsections.