preflight

package
v0.7.0-beta.10 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2023 License: AGPL-3.0 Imports: 31 Imported by: 0

Documentation

Index

Constants

View Source
const (
	StorageClassPath       = "cluster-resources/storage-classes.json"
	StorageClassErrorsPath = "cluster-resources/storage-classes-errors.json"
)
View Source
const (
	FailMessage = "Failed items were found. Please resolve the failed items and try again."
)

Variables

This section is empty.

Functions

func CollectCluster

func CollectCluster(ctx context.Context,
	opts preflight.CollectOpts,
	allCollectors []pkgcollector.Collector,
	allCollectorsMap map[reflect.Type][]pkgcollector.Collector,
	kbPreflight *preflightv1beta2.Preflight,
	helmOpts *values.Options,
	client *kubernetes.Clientset,
) (preflight.CollectResult, error)

CollectCluster collects cluster data against by Collector, and returns the collected data which is encapsulated in CollectResult struct

func CollectClusterData

func CollectClusterData(ctx context.Context, kbPreflight *preflightv1beta2.Preflight, f cmdutil.Factory, helmOpts *values.Options, progressCh chan interface{}) (*preflight.CollectResult, error)

CollectClusterData transforms the specs of Preflight to Collector, and sets the collectOpts, such as restConfig, Namespace, and ProgressChan

func CollectHost

CollectHost collects host data against by HostCollector, and returns the collected data which is encapsulated in CollectResult struct

func CollectHostData

func CollectHostData(ctx context.Context, hostPreflight *preflightv1beta2.HostPreflight, progressCh chan interface{}) (*preflight.CollectResult, error)

CollectHostData transforms the specs of hostPreflight to HostCollector, and sets the collectOpts

func CollectPreflight

func CollectPreflight(f cmdutil.Factory, helmOpts *values.Options, ctx context.Context, kbPreflight *preflightv1beta2.Preflight, kbHostPreflight *preflightv1beta2.HostPreflight, progressCh chan interface{}) ([]preflight.CollectResult, error)

func CollectRemoteData

func CollectRemoteData(ctx context.Context, preflightSpec *preflightv1beta2.HostPreflight, f cmdutil.Factory, progressCh chan interface{}) (*preflight.CollectResult, error)

func ConcatHostPreflightSpec

ConcatHostPreflightSpec splices multiple HostPreflightSpec into one HostPreflight object

func ConcatPreflightSpec

func ConcatPreflightSpec(target *preflightv1beta2.Preflight, source *preflightv1beta2.Preflight) *preflightv1beta2.Preflight

ConcatPreflightSpec splices multiple PreflightSpec into one Preflight object

func ExtractHostPreflightSpec

func ExtractHostPreflightSpec(kb *preflightv1beta2.HostPreflight) *troubleshoot.HostPreflight

ExtractHostPreflightSpec extracts spec of troubleshootv1beta2.HostPreflight from preflightv1beta2.HostPreflight

func LoadPreflightSpec

func LoadPreflightSpec(checkFileList []string, checkYamlData [][]byte) (*preflightv1beta2.Preflight, *preflightv1beta2.HostPreflight, string, error)

LoadPreflightSpec loads content of preflightSpec and hostPreflightSpec against yamlFiles from args

func ParseTimeFlags

func ParseTimeFlags(sinceTimeStr, sinceStr string, collectors []*troubleshoot.Collect) error

func ShowTextResults

func ShowTextResults(preflightName string, analyzeResults []*analyzerunner.AnalyzeResult, format string, verbose bool, out io.Writer) error

ShowTextResults shadows interactive mode, and exports results by customized format

Types

type KBClusterCollectResult

type KBClusterCollectResult struct {
	preflight.ClusterCollectResult
	HelmOptions     *values.Options
	AnalyzerSpecs   []*troubleshoot.Analyze
	KbAnalyzerSpecs []*preflightv1beta2.ExtendAnalyze
}

func (KBClusterCollectResult) Analyze

type KBHostCollectResult

type KBHostCollectResult struct {
	preflight.HostCollectResult
	AnalyzerSpecs   []*troubleshoot.HostAnalyze
	KbAnalyzerSpecs []*preflightv1beta2.ExtendHostAnalyze
}

func (KBHostCollectResult) Analyze

func (c KBHostCollectResult) Analyze() []*analyze.AnalyzeResult

type TextOutput

type TextOutput struct {
	Pass []TextResultOutput `json:"pass,omitempty" yaml:"pass,omitempty"`
	Warn []TextResultOutput `json:"warn,omitempty" yaml:"warn,omitempty"`
	Fail []TextResultOutput `json:"fail,omitempty" yaml:"fail,omitempty"`
}

func NewTextOutput

func NewTextOutput() TextOutput

type TextResultOutput

type TextResultOutput struct {
	Title   string `json:"title" yaml:"title"`
	Message string `json:"message" yaml:"message"`
	URI     string `json:"uri,omitempty" yaml:"uri,omitempty"`
	Strict  bool   `json:"strict,omitempty" yaml:"strict,omitempty"`
}

func NewTextResultOutput

func NewTextResultOutput(title, message, uri string) TextResultOutput

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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