cmd

package
v0.6.0-rc2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	FlagNamespace      = "namespace"
	FlagIstioNamespace = "istioNamespace"
	FlagCharts         = "charts"
)
View Source
const (
	ExitUnknownError   = 1 // for compatibility with existing exit code
	ExitIncorrectUsage = 64
	ExitDataError      = 65 // some format error with input data

	// below here are non-zero exit codes that don't indicate an error with istioctl itself
	ExitAnalyzerFoundIssues = 79 // istioctl analyze found issues, for CI/CD
)

Values should try to use sendmail-style values as in <sysexits.h> See e.g. https://man.openbsd.org/sysexits.3 or `less /usr/includes/sysexits.h` if you're on Linux

Picking the right range is tricky--there are a lot of reserved ones (see https://www.tldp.org/LDP/abs/html/exitcodes.html#EXITCODESREF) and then some used by convention (see sysexits).

The intention here is to use 64-78 in a way that matches the attempt in sysexits to signify some error running istioctl, and use 79-125 as custom error codes for other info that we'd like to use to pass info on.

View Source
const (

	// ExperimentalMsg indicate active development and not for production use warning.
	ExperimentalMsg = `THIS COMMAND IS UNDER ACTIVE DEVELOPMENT AND NOT READY FOR PRODUCTION USE.`
)
View Source
const FileParseString = "Some files couldn't be parsed."

Variables

View Source
var (
	// IstioConfig is the name of the istioctl config file (if any)
	IstioConfig = env.RegisterStringVar("ISTIOCONFIG", defaultIstioctlConfig,
		"Default values for istioctl flags").Get()
)

Functions

func Analyze

func Analyze() *cobra.Command

Analyze command

func AnalyzersAsString

func AnalyzersAsString(analyzers []analysis.Analyzer) string

func AuthZ

func AuthZ() *cobra.Command

AuthZ groups commands used for inspecting and interacting the authorization policy. Note: this is still under active development and is not ready for real use.

func ConfigAndEnvProcessing

func ConfigAndEnvProcessing() error

ConfigAndEnvProcessing uses spf13/viper for overriding CLI parameters

func GetExitCode

func GetExitCode(e error) int

func GetFirstPod

func GetFirstPod(client v1.CoreV1Interface, namespace string, selector string) (*corev1.Pod, error)

GetFirstPod returns a pod matching the namespace and label selector and the number of all pods that match the label selector. This is forked from polymorphichelpers.GetFirstPod to not watch and instead return an error if no pods are found

func GetRootCmd

func GetRootCmd(args []string) *cobra.Command

GetRootCmd returns the root of the cobra command-tree.

func HandlerForDebugErrors

func HandlerForDebugErrors(kubeClient kube.ExtendedClient,
	centralOpts *clioptions.CentralControlPlaneOptions,
	writer io.Writer,
	xdsResponses map[string]*xdsapi.DiscoveryResponse) (map[string]*xdsapi.DiscoveryResponse, error)

func HandlerForRetrieveDebugList

func HandlerForRetrieveDebugList(kubeClient kube.ExtendedClient,
	centralOpts clioptions.CentralControlPlaneOptions,
	writer io.Writer) (map[string]*xdsapi.DiscoveryResponse, error)

Types

type AnalyzerFoundIssuesError

type AnalyzerFoundIssuesError struct{}

AnalyzerFoundIssuesError indicates that at least one analyzer found problems.

func (AnalyzerFoundIssuesError) Error

func (f AnalyzerFoundIssuesError) Error() string

type CommandParseError

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

CommandParseError distinguishes an error parsing istioctl CLI arguments from an error processing

func (CommandParseError) Error

func (c CommandParseError) Error() string

type ControlzClient

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

func (*ControlzClient) GetScope

func (c *ControlzClient) GetScope(scope string) (*ScopeInfo, error)

func (*ControlzClient) GetScopes

func (c *ControlzClient) GetScopes() ([]*ScopeInfo, error)

func (*ControlzClient) PutScope

func (c *ControlzClient) PutScope(scope *ScopeInfo) error

func (*ControlzClient) PutScopes

func (c *ControlzClient) PutScopes(scopes []*ScopeInfo) error

type ExternalInjector

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

func (ExternalInjector) Inject

func (e ExternalInjector) Inject(pod *corev1.Pod, deploymentNS string) ([]byte, error)

type FileParseError

type FileParseError struct{}

FileParseError indicates a provided file was unable to be parsed.

func (FileParseError) Error

func (f FileParseError) Error() string

type IstioOperatorCRInfo

type IstioOperatorCRInfo struct {
	IOP            *iopv1alpha1.IstioOperator `json:"-"`
	Namespace      string                     `json:"namespace"`
	Name           string                     `json:"name"`
	Profile        string                     `json:"profile"`
	Components     []string                   `json:"components,omitempty"`
	Customizations []iopDiff                  `json:"customizations,omitempty"`
}

IstioOperatorCRInfo represents a tiny subset of fields from IstioOperator CR. This structure is used for displaying data. Exposed for integration test

type Level

type Level int

Level is an enumeration of all supported log levels.

const (
	// OffLevel disables logging
	OffLevel Level = iota
	// CriticalLevel enables critical level logging
	CriticalLevel
	// ErrorLevel enables error level logging
	ErrorLevel
	// WarningLevel enables warning level logging
	WarningLevel
	// InfoLevel enables info level logging
	InfoLevel
	// DebugLevel enables debug level logging
	DebugLevel
	// TraceLevel enables trace level logging
	TraceLevel
)

type MutatingWebhookConfigInfo

type MutatingWebhookConfigInfo struct {
	Name     string `json:"name"`
	Revision string `json:"revision"`
	Tag      string `json:"tag,omitempty"`
}

MutatingWebhookConfigInfo represents a tiny subset of fields from MutatingWebhookConfiguration kubernetes object. This is exposed for integration tests only

type NsInfo

type NsInfo struct {
	Name string             `json:"name,omitempty"`
	Pods []*PodFilteredInfo `json:"pods,omitempty"`
}

NsInfo represents namespace related information like pods running there. It is used to display data and is exposed for integration tests.

type PodFilteredInfo

type PodFilteredInfo struct {
	Namespace string      `json:"namespace"`
	Name      string      `json:"name"`
	Address   string      `json:"address"`
	Status    v1.PodPhase `json:"status"`
	Age       string      `json:"age"`
}

PodFilteredInfo represents a small subset of fields from Pod object in Kubernetes. Exposed for integration test

type RevisionDescription

type RevisionDescription struct {
	IstioOperatorCRs   []*IstioOperatorCRInfo       `json:"istio_operator_crs,omitempty"`
	Webhooks           []*MutatingWebhookConfigInfo `json:"webhooks,omitempty"`
	ControlPlanePods   []*PodFilteredInfo           `json:"control_plane_pods,omitempty"`
	IngressGatewayPods []*PodFilteredInfo           `json:"ingess_gateways,omitempty"`
	EgressGatewayPods  []*PodFilteredInfo           `json:"egress_gateways,omitempty"`
	NamespaceSummary   map[string]*NsInfo           `json:"namespace_summary,omitempty"`
}

RevisionDescription is used to display revision related information. This is exposed for integration tests.

type ScopeInfo

type ScopeInfo struct {
	Name            string `json:"name"`
	Description     string `json:"description,omitempty"`
	OutputLevel     string `json:"output_level,omitempty"`
	StackTraceLevel string `json:"stack_trace_level,omitempty"`
	LogCallers      bool   `json:"log_callers,omitempty"`
}

type ScopeLevelPair

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

type Workloader

type Workloader interface {
	GetSelector() *typev1beta1.WorkloadSelector
}

Workloader is used for matching all configs

Directories

Path Synopsis
Command istioctl is a Istio configuration command line utility.
Command istioctl is a Istio configuration command line utility.

Jump to

Keyboard shortcuts

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