Documentation
¶
Index ¶
Constants ¶
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 ¶
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 ¶
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.