Documentation ¶
Index ¶
- Constants
- func CheckAll(ob *common.CheckOptions) error
- func CheckCPU() error
- func CheckDNS(domain string) error
- func CheckDNSSpecify(domain string, dns string) error
- func CheckDisk() error
- func CheckErr(err error, handleErr func(string, int))
- func CheckHTTP(url string) error
- func CheckMemory() error
- func CheckNetWork(IP string, timeout int, cloudhubServer string, edgecoreServer string, ...) error
- func CheckPid() error
- func CheckRuntime(runtime string) error
- func ConvertDataToTable(obj runtime.Object) (runtime.Object, error)
- func CopyFile(pathSrc, tmpPath string) error
- func DiagnoseInstall(ob *common.CheckOptions) error
- func DiagnoseNode(ops *common.DiagnoseOptions) error
- func DiagnosePod(ops *common.DiagnoseOptions, podName string) error
- func ExecuteCollect(collectOptions *common.CollectOptions) error
- func ExecuteShell(cmdStr string, tmpPath string) error
- func FilterSelector(data []dao.Meta, selector string) ([]dao.Meta, error)
- func HumanReadablePrint(results []dao.Meta, printer printers.ResourcePrinter) error
- func InitDB(driverName, dbName, dataSource string) error
- func JSONYamlPrint(results []dao.Meta, printer printers.ResourcePrinter) error
- func NewCheck() *cobra.Command
- func NewCheckOptions() *common.CheckOptions
- func NewCmdDebugGet() *cobra.Command
- func NewCollect() *cobra.Command
- func NewDiagnose() *cobra.Command
- func NewDiagnoseOptions() *common.DiagnoseOptions
- func NewEdgeDebug() *cobra.Command
- func NewSubDiagnose(object Diagnose) *cobra.Command
- func NewSubEdgeCheck(object CheckObject) *cobra.Command
- func ParseMetaToAPIList(metas []dao.Meta) (res []runtime.Object, err error)
- func ParseMetaToV1List(results []dao.Meta) ([]runtime.Object, error)
- func PrintGeneric(printer printers.ResourcePrinter, obj runtime.Object) error
- func QueryPodFromDatabase(resNamePaces string, podName string) (*v1.PodStatus, error)
- func VerificationParameters(collectOptions *common.CollectOptions) error
- type CheckObject
- type Diagnose
- type GetOptions
- type HumanPrintFlags
- type PrintFlags
- type Selector
Constants ¶
const ( // DefaultErrorExitCode defines exit the code for failed action generally DefaultErrorExitCode = 1 // ResourceTypeAll defines resource type all ResourceTypeAll = "all" // FormatTypeWIDE defines output format wide FormatTypeWIDE = "wide" )
Variables ¶
This section is empty.
Functions ¶
func CheckAll ¶
func CheckAll(ob *common.CheckOptions) error
func CheckDNSSpecify ¶
func CheckErr ¶
CheckErr formats a given error as a string and calls the passed handleErr func with that string and an exit code.
func CheckMemory ¶
func CheckMemory() error
func CheckNetWork ¶
func CheckRuntime ¶
func ConvertDataToTable ¶
ConvertDataToTable Convert the data into table kind to simulate the data sent by api-server
func DiagnoseInstall ¶
func DiagnoseInstall(ob *common.CheckOptions) error
func DiagnoseNode ¶
func DiagnoseNode(ops *common.DiagnoseOptions) error
func DiagnosePod ¶
func DiagnosePod(ops *common.DiagnoseOptions, podName string) error
func ExecuteCollect ¶
func ExecuteCollect(collectOptions *common.CollectOptions) error
ExecuteCollect starts to collect data
func ExecuteShell ¶
func FilterSelector ¶
FilterSelector filter resource by selector
func HumanReadablePrint ¶
func HumanReadablePrint(results []dao.Meta, printer printers.ResourcePrinter) error
func JSONYamlPrint ¶
func JSONYamlPrint(results []dao.Meta, printer printers.ResourcePrinter) error
JSONYamlPrint Output the data in json|yaml format
func NewCheckOptions ¶ added in v1.8.0
func NewCheckOptions() *common.CheckOptions
NewCheckOptions returns check options
func NewCmdDebugGet ¶
NewCmdDebugGet returns keadm debug get command.
func NewDiagnose ¶
NewDiagnose returns KubeEdge edge debug Diagnose command.
func NewDiagnoseOptions ¶ added in v1.8.0
func NewDiagnoseOptions() *common.DiagnoseOptions
NewDiagnoseOptions returns diagnose options
func NewEdgeDebug ¶
NewEdgeDebug returns KubeEdge edge debug command.
func NewSubDiagnose ¶
func NewSubEdgeCheck ¶
func NewSubEdgeCheck(object CheckObject) *cobra.Command
NewSubEdgeCheck returns KubeEdge edge check subcommand.
func ParseMetaToAPIList ¶
xParseMetaToAPIList Convert the data to the corresponding list type according to the apiserver usage type Only use this type definition to get the table header processing handle, and automatically obtain the ColumnDefinitions of the table according to the type Only used by HumanReadablePrint.
func ParseMetaToV1List ¶
ParseMetaToV1List Convert the data to the corresponding list type The type definition used by apiserver does not have the omitempty definition of json, will introduce a lot of useless null information Use v1 type definition to get data here Only used by JSONYamlPrint.
func PrintGeneric ¶
func PrintGeneric(printer printers.ResourcePrinter, obj runtime.Object) error
PrintGeneric Output object data to out stream through printer
func QueryPodFromDatabase ¶
func VerificationParameters ¶
func VerificationParameters(collectOptions *common.CollectOptions) error
VerificationParameters verifies parameters for debug collect
Types ¶
type CheckObject ¶
type CheckObject common.CheckObject
func (*CheckObject) ExecuteCheck ¶
func (co *CheckObject) ExecuteCheck(use string, ob *common.CheckOptions)
ExecuteCheck starts to check data
type Diagnose ¶
type Diagnose common.DiagnoseObject
func (Diagnose) ExecuteDiagnose ¶
func (da Diagnose) ExecuteDiagnose(use string, ops *common.DiagnoseOptions, args []string)
type GetOptions ¶
type GetOptions struct { AllNamespace bool Namespace string LabelSelector string DataPath string PrintFlags *PrintFlags }
GetOptions contains the input to the get command.
func NewGetOptions ¶
func NewGetOptions() *GetOptions
NewGetOptions returns a GetOptions with default EdgeCore database source.
func (*GetOptions) IsAllowedFormat ¶
func (g *GetOptions) IsAllowedFormat(f string) bool
IsAllowedFormat verification support format
func (*GetOptions) Run ¶
func (g *GetOptions) Run(args []string) error
Run performs the get operation.
func (*GetOptions) Validate ¶
func (g *GetOptions) Validate(args []string) error
Validate checks the set of flags provided by the user.
type HumanPrintFlags ¶
type HumanPrintFlags struct { ShowKind *bool ShowLabels *bool SortBy *string ColumnLabels *[]string // get.go-specific values NoHeaders bool Kind schema.GroupKind WithNamespace bool }
HumanPrintFlags provides default flags necessary for printing. Given the following flag values, a printer can be requested that knows how to handle printing based on these values.
func NewHumanPrintFlags ¶
func NewHumanPrintFlags() *HumanPrintFlags
NewHumanPrintFlags returns flags associated with human-readable printing, with default values set.
func (*HumanPrintFlags) AllowedFormats ¶
func (f *HumanPrintFlags) AllowedFormats() []string
AllowedFormats returns more customized formating options
func (*HumanPrintFlags) EnsureWithNamespace ¶
func (f *HumanPrintFlags) EnsureWithNamespace() error
EnsureWithNamespace sets the "WithNamespace" humanreadable option to true.
func (*HumanPrintFlags) ToPrinter ¶
func (f *HumanPrintFlags) ToPrinter(outputFormat string) (printers.ResourcePrinter, error)
ToPrinter receives an outputFormat and returns a printer capable of handling human-readable output.
type PrintFlags ¶
type PrintFlags struct { JSONYamlPrintFlags *genericclioptions.JSONYamlPrintFlags NamePrintFlags *genericclioptions.NamePrintFlags HumanReadableFlags *HumanPrintFlags TemplateFlags *genericclioptions.KubeTemplatePrintFlags NoHeaders *bool OutputFormat *string }
PrintFlags composes common printer flag structs
func NewGetPrintFlags ¶
func NewGetPrintFlags() *PrintFlags
NewGetPrintFlags returns flags associated with JSONYamlPrintFlags
func (*PrintFlags) AllowedFormats ¶
func (f *PrintFlags) AllowedFormats() []string
AllowedFormats is the list of formats in which data can be displayed
func (*PrintFlags) EnsureWithNamespace ¶
func (f *PrintFlags) EnsureWithNamespace() error
EnsureWithNamespace ensures that humanreadable flags return a printer capable of printing with a "namespace" column.
func (*PrintFlags) ToPrinter ¶
func (f *PrintFlags) ToPrinter() (printers.ResourcePrinter, error)
ToPrinter attempts to find a composed set of PrintFlags suitable for returning a printer based on current flag values.