debug

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 9 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package debug holds the report "kubectl nv debug <node>" prints: one node as the inventory sees it, next to the must-gather bundle collected for it.

The type lives here rather than in the command package so that a reader of the output contract finds it where the other payload types are, and so that nothing in it depends on cobra.

Build every value through NewReport. The cli-runtime printers behind -o json, -o yaml and -o name read TypeMeta off the struct and refuse one whose GroupVersionKind is empty, and they do it before any marshalling, so MarshalJSON stamping the envelope does not reach them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bundle

type Bundle struct {
	// Directory is where the bundle was written. It is what the user sends.
	Directory string `json:"directory" yaml:"directory"`
	// Manifest is the path of the bundle's own index, empty when the gather
	// failed before it could write one.
	Manifest string `json:"manifest" yaml:"manifest"`
	// Collectors is how the gather's collectors ended.
	Collectors CollectorCounts `json:"collectors" yaml:"collectors"`
	// Skipped names the collectors that did not run, in the order they were
	// run in, each with its reason.
	Skipped []CollectorOutcome `json:"skipped" yaml:"skipped"`
	// Errored names the collectors that failed, in the same order.
	Errored []CollectorOutcome `json:"errored" yaml:"errored"`
	// Files is how many files the bundle indexes, not counting the index.
	Files int `json:"files" yaml:"files"`
	// Bytes is what those files add up to.
	Bytes int64 `json:"bytes" yaml:"bytes"`
}

Bundle is the must-gather this run collected, summarised. The bundle itself stays on disk; this says where it is and what is in it, so that a reader can tell a complete bundle from one that is missing the part they need without unpacking it.

func SummariseBundle

func SummariseBundle(dir string, m *mustgather.Manifest) Bundle

SummariseBundle reads the gather's own index into the summary this report carries. m is nil when the gather failed before it could write one, which is still a directory the user has to be told about.

The counts come from the manifest rather than from the directory: a collector that was refused wrote nothing, and counting files would report it as a collector that was never in the registry.

func (Bundle) MarshalJSON

func (b Bundle) MarshalJSON() ([]byte, error)

MarshalJSON renders the nil slices as empty arrays.

type CollectorCounts

type CollectorCounts struct {
	// OK is how many collectors ran and wrote what they planned to.
	OK int `json:"ok" yaml:"ok"`
	// Skipped is how many had nothing to do, or were kept out by a flag, or
	// were refused.
	Skipped int `json:"skipped" yaml:"skipped"`
	// Error is how many failed.
	Error int `json:"error" yaml:"error"`
}

CollectorCounts is how the gather's collectors ended, one count per status. A skipped collector is counted apart from a successful one on purpose: a bundle whose driver evidence was refused and one that holds it must not add up to the same number.

type CollectorOutcome

type CollectorOutcome struct {
	// Name is the collector's name in the gather's registry.
	Name string `json:"name" yaml:"name"`
	// Reason is what the manifest recorded after the status prefix, for
	// instance "--no-exec" or "forbidden: ...".
	Reason string `json:"reason" yaml:"reason"`
}

CollectorOutcome names one collector that did not simply run, and why.

type Report

type Report struct {
	metav1.TypeMeta `json:",inline" yaml:",inline"`
	// ObjectMeta is the apimachinery type so that the cli-runtime printers can
	// reach the name through meta.Accessor. The name is the node's.
	metav1.ObjectMeta `json:"metadata,omitzero" yaml:"metadata,omitempty"`

	// Node is the node, built exactly as kubectl nv info builds it.
	Node inventory.GPUNode `json:"node" yaml:"node"`
	// Bundle is the must-gather collected for that node.
	Bundle Bundle `json:"bundle" yaml:"bundle"`
	// Status is what the run could not see, from the inventory read and from
	// the gather both. The exit code is read from it.
	Status output.ReportStatus `json:"status" yaml:"status"`
}

Report is everything kubectl nv debug gathered about one node: the node as kubectl nv info builds it, the bundle collected for it, and what the run could not see.

There are no findings in it. Deciding whether the node is healthy is kubectl nv health's job, and a second command answering the same question its own way is a second answer to disagree with.

func NewReport

func NewReport(node string) *Report

NewReport returns a report for one node, stamped with the API version and carrying the node's name. Every report handed to a printer comes from here.

func (*Report) DeepCopy

func (r *Report) DeepCopy() *Report

DeepCopy returns a copy of the receiver.

func (*Report) DeepCopyInto

func (r *Report) DeepCopyInto(out *Report)

DeepCopyInto copies the receiver into out.

func (*Report) DeepCopyObject

func (r *Report) DeepCopyObject() runtime.Object

DeepCopyObject implements runtime.Object.

func (Report) MarshalJSON

func (r Report) MarshalJSON() ([]byte, error)

MarshalJSON stamps the envelope. The guarantee belongs on the type rather than on the constructor: a zero value from a test still has to come off the wire looking like every other report.

Jump to

Keyboard shortcuts

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