Documentation ¶
Index ¶
- Constants
- func CollectCluster(ctx context.Context, opts preflight.CollectOpts, ...) (preflight.CollectResult, error)
- func CollectClusterData(ctx context.Context, kbPreflight *preflightv1beta2.Preflight, ...) (*preflight.CollectResult, error)
- func CollectHost(ctx context.Context, opts preflight.CollectOpts, ...) (preflight.CollectResult, error)
- func CollectHostData(ctx context.Context, hostPreflight *preflightv1beta2.HostPreflight, ...) (*preflight.CollectResult, error)
- func CollectPreflight(f cmdutil.Factory, helmOpts *values.Options, ctx context.Context, ...) ([]preflight.CollectResult, error)
- func CollectRemoteData(ctx context.Context, preflightSpec *preflightv1beta2.HostPreflight, ...) (*preflight.CollectResult, error)
- func ConcatHostPreflightSpec(target *preflightv1beta2.HostPreflight, source *preflightv1beta2.HostPreflight) *preflightv1beta2.HostPreflight
- func ConcatPreflightSpec(target *preflightv1beta2.Preflight, source *preflightv1beta2.Preflight) *preflightv1beta2.Preflight
- func ExtractHostPreflightSpec(kb *preflightv1beta2.HostPreflight) *troubleshoot.HostPreflight
- func LoadPreflightSpec(checkFileList []string, checkYamlData [][]byte) (*preflightv1beta2.Preflight, *preflightv1beta2.HostPreflight, string, error)
- func ParseTimeFlags(sinceTimeStr, sinceStr string, collectors []*troubleshoot.Collect) error
- func ShowTextResults(preflightName string, analyzeResults []*analyzerunner.AnalyzeResult, ...) error
- type KBClusterCollectResult
- type KBHostCollectResult
- type TextOutput
- type TextResultOutput
Constants ¶
const ( FailMessage = "Fail items were found. Please resolve the fail items and try again." PassMessage = "The kubernetes cluster preflight check pass, and you can enjoy KubeBlocks now." )
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, ) (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 ¶
func CollectHost(ctx context.Context, opts preflight.CollectOpts, collectors []pkgcollector.HostCollector, hostPreflight *preflightv1beta2.HostPreflight) (preflight.CollectResult, error)
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 ¶
func ConcatHostPreflightSpec(target *preflightv1beta2.HostPreflight, source *preflightv1beta2.HostPreflight) *preflightv1beta2.HostPreflight
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) 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 ¶
func (c KBClusterCollectResult) Analyze() []*analyze.AnalyzeResult
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