Help us shape the future of Go! Take the 2026 Go Developer Survey

diagnostics

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Overview

Package diagnostics collects failure diagnostics from an e2e cluster (pod logs, kubectl describes, DaemonSet state) into an artifact directory when a spec fails.

Index

Constants

View Source
const (
	// Pods is a core-group resource kind the diagnostic collectors handle.
	Pods       = "pods"
	Nodes      = "nodes"
	Namespaces = "namespaces"

	// Deployments is an apps-group resource kind the diagnostic collectors handle.
	Deployments = "deployments"
	DaemonSets  = "daemonsets"

	// Jobs is a batch-group resource kind the diagnostic collectors handle.
	Jobs = "jobs"

	// NodeFeature is an NFD extension kind the diagnostic collectors handle.
	NodeFeature     = "nodeFeature"
	NodeFeatureRule = "nodeFeatureRule"
)

Resource-kind names the diagnostic collectors accept via WithObjects.

Variables

This section is empty.

Functions

func WithArtifactDir

func WithArtifactDir(artifactDir string) func(*Diagnostic)

WithArtifactDir sets the on-disk directory dumps are written to.

func WithKubernetesClient

func WithKubernetesClient(clientset kubernetes.Interface) func(*Diagnostic)

WithKubernetesClient wires in the core Kubernetes clientset the collectors use.

func WithNFDClient

func WithNFDClient(nfdClient *nfdclient.Clientset) func(*Diagnostic)

WithNFDClient wires in the NFD clientset for NodeFeature / NodeFeatureRule dumps.

func WithNamespace

func WithNamespace(namespace string) func(*Diagnostic)

WithNamespace scopes collection to the given namespace.

func WithObjects

func WithObjects(objects ...string) func(*Diagnostic)

WithObjects selects which resource kinds (see the Pods/Nodes/... consts) to dump.

Types

type Collector

type Collector interface {
	Collect(context.Context) error
}

Collector is one dumper of a specific resource kind.

type Config

type Config struct {
	Clientset kubernetes.Interface
	NfdClient *nfdclientset.Clientset
	// contains filtered or unexported fields
}

Config is the shared state Collector implementations read from.

type Diagnostic

type Diagnostic struct {
	*Config
	// contains filtered or unexported fields
}

Diagnostic is a configured collector set that dumps failure artifacts.

func New

func New(opts ...Option) (*Diagnostic, error)

New builds a Diagnostic from the given options.

func (*Diagnostic) Collect

func (d *Diagnostic) Collect(ctx context.Context) error

Collect runs every configured collector and writes their dumps to the artifact directory.

type Option

type Option func(*Diagnostic)

Option mutates a Diagnostic during New.

Jump to

Keyboard shortcuts

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