azure

package
v0.1.87 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: Apache-2.0 Imports: 38 Imported by: ? modules, 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

Index

Constants

View Source
const (
	StatusCollected = "collected"
	StatusSkipped   = "skipped"
	StatusEmpty     = "empty"
	StatusFailed    = "failed"
	StatusTimedOut  = "timed-out"
)

Variables

This section is empty.

Functions

func VerifyArtifacts

func VerifyArtifacts(artifactDir string, report CollectionReport, expected []string, requireJournals bool) error

VerifyArtifacts requires fresh collected artifacts for every expected machine. Callers must supply their independent pre-collection machine inventory. Empty inventories, duplicate entries, missing files and empty gzip payloads fail. Journals are required only when requireJournals is true.

Types

type ArtifactResult

type ArtifactResult struct {
	Status     string             `json:"status"`
	Reason     string             `json:"reason,omitempty"`
	Path       string             `json:"path,omitempty"`
	Bytes      int64              `json:"bytes,omitempty"`
	Compressed bool               `json:"compressed,omitempty"`
	LineLimit  int                `json:"lineLimit,omitempty"`
	ByteLimit  int64              `json:"byteLimit,omitempty"`
	Truncated  bool               `json:"truncated,omitempty"`
	Attempts   []TransportAttempt `json:"attempts,omitempty"`
}

ArtifactResult reports only completed artifacts as collected. Bytes counts uncompressed content. Truncated records a reached line or byte bound.

type CollectionReport

type CollectionReport struct {
	Machines []MachineResult `json:"machines"`
	Error    string          `json:"error,omitempty"`
}

CollectionReport records outcomes, including machines without guest access.

func CollectMachineDiagnostics

func CollectMachineDiagnostics(ctx context.Context, kubeClient client.Client, hc *hyperv1.HostedCluster, opts DiagnosticsOptions, logger logr.Logger) (CollectionReport, error)

CollectMachineDiagnostics collects serial logs before attempting journals. Missing Azure credentials do not prevent API or configured SSH journal access. The report is also written to machine-diagnostics.json, including empty discovery.

type DiagnosticsOptions

type DiagnosticsOptions struct {
	CredentialsFile  string
	ArtifactDir      string
	ManagementConfig *rest.Config
	SSH              *SSHOptions
	// SerialOnly avoids guest access when validating workers that cannot register.
	SerialOnly bool
	// contains filtered or unexported fields
}

DiagnosticsOptions configures independent serial and journal collection. SSH is attempted only after unsuccessful API journal collection and only when configured.

type JournalCollector

type JournalCollector func(context.Context, capiazure.AzureMachine, string, io.Writer) error

JournalCollector writes stdout only; command failure must be returned separately.

type MachineResult

type MachineResult struct {
	Name            string                    `json:"name"`
	BootDiagnostics string                    `json:"bootDiagnostics"`
	Serial          ArtifactResult            `json:"serial"`
	Journals        map[string]ArtifactResult `json:"journals"`
}

MachineResult associates artifacts with their AzureMachine rather than a Node.

type SSHOptions

type SSHOptions struct {
	PrivateKeyFile string
	JumpHost       string
	KnownHostsFile string
}

SSHOptions enables fallback through already configured worker SSH connectivity. No network rules, agents or bastions are created by the collector.

func SSHOptionsFromEnv

func SSHOptionsFromEnv() *SSHOptions

SSHOptionsFromEnv returns nil unless AZURE_JOURNAL_SSH_KEY explicitly enables SSH.

type TransportAttempt

type TransportAttempt struct {
	Transport string `json:"transport"`
	Status    string `json:"status"`
	Reason    string `json:"reason,omitempty"`
}

TransportAttempt preserves the API failure when an SSH fallback succeeds.

Jump to

Keyboard shortcuts

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