debug

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 39 Imported by: 1

Documentation

Index

Constants

View Source
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 CheckCPU

func CheckCPU() error

func CheckDNS

func CheckDNS(domain string) error

func CheckDNSSpecify

func CheckDNSSpecify(domain string, dns string) error

func CheckDisk

func CheckDisk() error

func CheckErr

func CheckErr(err error, handleErr func(string, int))

CheckErr formats a given error as a string and calls the passed handleErr func with that string and an exit code.

func CheckHTTP

func CheckHTTP(url string) error

func CheckMemory

func CheckMemory() error

func CheckNetWork

func CheckNetWork(IP string, timeout int, cloudhubServer string, edgecoreServer string, config string) error

func CheckPid

func CheckPid() error

func CheckRuntime

func CheckRuntime() error

func ConvertDataToTable

func ConvertDataToTable(obj runtime.Object) (runtime.Object, error)

ConvertDataToTable Convert the data into table kind to simulate the data sent by api-server

func CopyFile

func CopyFile(pathSrc, tmpPath string) error

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 ExecuteShell(cmdStr string, tmpPath string) error

func FilterSelector

func FilterSelector(data []dao.Meta, selector string) ([]dao.Meta, error)

FilterSelector filter resource by selector

func HumanReadablePrint

func HumanReadablePrint(results []dao.Meta, printer printers.ResourcePrinter) error

func InitDB

func InitDB(driverName, dbName, dataSource string) error

InitDB Init DB info

func JSONYamlPrint

func JSONYamlPrint(results []dao.Meta, printer printers.ResourcePrinter) error

JSONYamlPrint Output the data in json|yaml format

func NewCheck

func NewCheck() *cobra.Command

NewCheck returns KubeEdge edge check command.

func NewCheckOptions added in v1.8.0

func NewCheckOptions() *common.CheckOptions

NewCheckOptions returns check options

func NewCmdDebugGet

func NewCmdDebugGet() *cobra.Command

NewCmdDebugGet returns keadm debug get command.

func NewCollect

func NewCollect() *cobra.Command

NewCollect returns KubeEdge collect command.

func NewDiagnose

func NewDiagnose() *cobra.Command

NewDiagnose returns KubeEdge edge debug Diagnose command.

func NewDiagnoseOptions added in v1.8.0

func NewDiagnoseOptions() *common.DiagnoseOptions

NewDiagnoseOptions returns diagnose options

func NewEdgeDebug

func NewEdgeDebug() *cobra.Command

NewEdgeDebug returns KubeEdge edge debug command.

func NewSubDiagnose

func NewSubDiagnose(object Diagnose) *cobra.Command

func NewSubEdgeCheck

func NewSubEdgeCheck(object CheckObject) *cobra.Command

NewSubEdgeCheck returns KubeEdge edge check subcommand.

func ParseMetaToAPIList

func ParseMetaToAPIList(metas []dao.Meta) (res []runtime.Object, err error)

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

func ParseMetaToV1List(results []dao.Meta) ([]runtime.Object, error)

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 QueryPodFromDatabase(resNamePaces string, podName string) (*v1.PodStatus, error)

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.

type Selector

type Selector struct {
	Key   string
	Value string
	Exist bool
}

Selector filter structure

func SplitSelectorParameters

func SplitSelectorParameters(args string) ([]Selector, error)

SplitSelectorParameters Split selector args (flag: -l)

Jump to

Keyboard shortcuts

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