diagnostics

package
v0.18.3 Latest Latest
Warning

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

Go to latest
Published: Dec 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewAnalyzerFactory

func NewAnalyzerFactory() *analyzerFactory

func NewFactory

func NewFactory(opts EksaDiagnosticBundleFactoryOpts) *eksaDiagnosticBundleFactory

func ParseTimeFromDuration

func ParseTimeFromDuration(since string) (*time.Time, error)

func ParseTimeOptions

func ParseTimeOptions(since string, sinceTime string) (*time.Time, error)

Types

type Analyze

type Analyze struct {
	CustomResourceDefinition *customResourceDefinition `json:"customResourceDefinition,omitempty"`
	Secret                   *analyzeSecret            `json:"secret,omitempty"`
	ImagePullSecret          *imagePullSecret          `json:"imagePullSecret,omitempty"`
	DeploymentStatus         *deploymentStatus         `json:"deploymentStatus,omitempty"`
	TextAnalyze              *textAnalyze              `json:"textAnalyze,omitempty"`
}

type AnalyzerFactory

type AnalyzerFactory interface {
	DefaultAnalyzers() []*Analyze
	EksaGitopsAnalyzers() []*Analyze
	EksaLogTextAnalyzers(collectors []*Collect) []*Analyze
	EksaOidcAnalyzers() []*Analyze
	EksaExternalEtcdAnalyzers() []*Analyze
	DataCenterConfigAnalyzers(datacenter v1alpha1.Ref) []*Analyze
	ManagementClusterAnalyzers() []*Analyze
	PackageAnalyzers() []*Analyze
}

type BundleClient

type BundleClient interface {
	Collect(ctx context.Context, bundlePath string, sinceTime *time.Time, kubeconfig string) (archivePath string, err error)
	Analyze(ctx context.Context, bundleSpecPath string, archivePath string) ([]*executables.SupportBundleAnalysis, error)
}

type Collect

type Collect struct {
	ClusterInfo      *clusterInfo      `json:"clusterInfo,omitempty"`
	ClusterResources *clusterResources `json:"clusterResources,omitempty"`
	Secret           *secret           `json:"secret,omitempty"`
	Logs             *logs             `json:"logs,omitempty"`
	Data             *data             `json:"data,omitempty"`
	CopyFromHost     *copyFromHost     `json:"copyFromHost,omitempty"`
	Exec             *exec             `json:"exec,omitempty"`
	RunPod           *runPod           `json:"runPod,omitempty"`
}

type CollectorFactory

type CollectorFactory interface {
	PackagesCollectors() []*Collect
	DefaultCollectors() []*Collect
	FileCollectors(paths []string) []*Collect
	ManagementClusterCollectors() []*Collect
	EksaHostCollectors(configs []providers.MachineConfig) []*Collect
	DataCenterConfigCollectors(datacenter v1alpha1.Ref, spec *cluster.Spec) []*Collect
}

CollectorFactory generates support-bundle collectors.

type DiagnosticBundle

type DiagnosticBundle interface {
	PrintBundleConfig() error
	WriteBundleConfig() error
	PrintAnalysis() error
	WriteAnalysisToFile() (path string, err error)
	CollectAndAnalyze(ctx context.Context, sinceTimeValue *time.Time) error
	WithDefaultAnalyzers() *EksaDiagnosticBundle
	WithDefaultCollectors() *EksaDiagnosticBundle
	WithFileCollectors(paths []string) *EksaDiagnosticBundle
	WithDatacenterConfig(config v1alpha1.Ref, spec *cluster.Spec) *EksaDiagnosticBundle
	WithOidcConfig(config *v1alpha1.OIDCConfig) *EksaDiagnosticBundle
	WithExternalEtcd(config *v1alpha1.ExternalEtcdConfiguration) *EksaDiagnosticBundle
	WithGitOpsConfig(config *v1alpha1.GitOpsConfig) *EksaDiagnosticBundle
	WithMachineConfigs(configs []providers.MachineConfig) *EksaDiagnosticBundle
	WithLogTextAnalyzers() *EksaDiagnosticBundle
}

type DiagnosticBundleFactory

type DiagnosticBundleFactory interface {
	DiagnosticBundle(spec *cluster.Spec, provider providers.Provider, kubeconfig string, bundlePath string) (DiagnosticBundle, error)
	DiagnosticBundleWorkloadCluster(spec *cluster.Spec, provider providers.Provider, kubeconfig string) (DiagnosticBundle, error)
	DiagnosticBundleManagementCluster(spec *cluster.Spec, kubeconfig string) (DiagnosticBundle, error)
	DiagnosticBundleDefault() DiagnosticBundle
	DiagnosticBundleCustom(kubeconfig string, bundlePath string) DiagnosticBundle
}

type EKSACollectorFactory added in v0.15.0

type EKSACollectorFactory struct {
	DiagnosticCollectorImage string
	// contains filtered or unexported fields
}

EKSACollectorFactory generates support-bundle collectors for eks-a clusters.

func NewCollectorFactory

func NewCollectorFactory(diagnosticCollectorImage string, reader FileReader) *EKSACollectorFactory

NewCollectorFactory builds a collector factory.

func NewDefaultCollectorFactory

func NewDefaultCollectorFactory(reader FileReader) *EKSACollectorFactory

NewDefaultCollectorFactory builds a collector factory that will use the default diagnostic collector image.

func (*EKSACollectorFactory) DataCenterConfigCollectors added in v0.15.0

func (c *EKSACollectorFactory) DataCenterConfigCollectors(datacenter v1alpha1.Ref, spec *cluster.Spec) []*Collect

DataCenterConfigCollectors returns the collectors for the provider datacenter config in the cluster spec.

func (*EKSACollectorFactory) DefaultCollectors added in v0.15.0

func (c *EKSACollectorFactory) DefaultCollectors() []*Collect

DefaultCollectors returns the collectors that apply to all clusters.

func (*EKSACollectorFactory) EksaHostCollectors added in v0.15.0

func (c *EKSACollectorFactory) EksaHostCollectors(machineConfigs []providers.MachineConfig) []*Collect

EksaHostCollectors returns the collectors that interact with the kubernetes node machine hosts.

func (*EKSACollectorFactory) FileCollectors added in v0.15.0

func (c *EKSACollectorFactory) FileCollectors(paths []string) []*Collect

FileCollectors returns the collectors that interact with files.

func (*EKSACollectorFactory) ManagementClusterCollectors added in v0.15.0

func (c *EKSACollectorFactory) ManagementClusterCollectors() []*Collect

ManagementClusterCollectors returns the collectors that only apply to management clusters.

func (*EKSACollectorFactory) PackagesCollectors added in v0.15.0

func (c *EKSACollectorFactory) PackagesCollectors() []*Collect

PackagesCollectors returns the collectors that read information for curated packages.

type EksaDiagnosticBundle

type EksaDiagnosticBundle struct {
	// contains filtered or unexported fields
}

func (*EksaDiagnosticBundle) CollectAndAnalyze

func (e *EksaDiagnosticBundle) CollectAndAnalyze(ctx context.Context, sinceTimeValue *time.Time) error

func (*EksaDiagnosticBundle) PrintAnalysis

func (e *EksaDiagnosticBundle) PrintAnalysis() error

func (*EksaDiagnosticBundle) PrintBundleConfig

func (e *EksaDiagnosticBundle) PrintBundleConfig() error

func (*EksaDiagnosticBundle) WithDatacenterConfig

func (e *EksaDiagnosticBundle) WithDatacenterConfig(config v1alpha1.Ref, spec *cluster.Spec) *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithDefaultAnalyzers

func (e *EksaDiagnosticBundle) WithDefaultAnalyzers() *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithDefaultCollectors

func (e *EksaDiagnosticBundle) WithDefaultCollectors() *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithExternalEtcd

func (*EksaDiagnosticBundle) WithFileCollectors added in v0.13.0

func (e *EksaDiagnosticBundle) WithFileCollectors(paths []string) *EksaDiagnosticBundle

WithFileCollectors appends collectors that collect static data from the specified paths to the bundle.

func (*EksaDiagnosticBundle) WithGitOpsConfig

func (e *EksaDiagnosticBundle) WithGitOpsConfig(config *v1alpha1.GitOpsConfig) *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithLogTextAnalyzers

func (e *EksaDiagnosticBundle) WithLogTextAnalyzers() *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithMachineConfigs

func (e *EksaDiagnosticBundle) WithMachineConfigs(configs []providers.MachineConfig) *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithManagementCluster

func (e *EksaDiagnosticBundle) WithManagementCluster(isSelfManaged bool) *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithOidcConfig

func (e *EksaDiagnosticBundle) WithOidcConfig(config *v1alpha1.OIDCConfig) *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WithPackagesCollectors added in v0.9.0

func (e *EksaDiagnosticBundle) WithPackagesCollectors() *EksaDiagnosticBundle

func (*EksaDiagnosticBundle) WriteAnalysisToFile

func (e *EksaDiagnosticBundle) WriteAnalysisToFile() (path string, err error)

func (*EksaDiagnosticBundle) WriteBundleConfig

func (e *EksaDiagnosticBundle) WriteBundleConfig() error

type EksaDiagnosticBundleFactoryOpts

type EksaDiagnosticBundleFactoryOpts struct {
	AnalyzerFactory  AnalyzerFactory
	Client           BundleClient
	CollectorFactory CollectorFactory
	Kubectl          *executables.Kubectl
	Writer           filewriter.FileWriter
}

type FileReader added in v0.15.0

type FileReader interface {
	ReadFile(url string) ([]byte, error)
}

FileReader reads files from local disk or http urls.

Directories

Path Synopsis
interfaces
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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