Documentation ¶
Index ¶
- Constants
- Variables
- func Analyze() *cobra.Command
- func AnalyzersAsString(analyzers []analysis.Analyzer) string
- func AuthZ() *cobra.Command
- func ConfigAndEnvProcessing() error
- func GetExitCode(e error) int
- func GetFirstPod(client v1.CoreV1Interface, namespace string, selector string) (*corev1.Pod, error)
- func GetRootCmd(args []string) *cobra.Command
- func HandlerForDebugErrors(kubeClient kube.ExtendedClient, ...) (map[string]*xdsapi.DiscoveryResponse, error)
- func HandlerForRetrieveDebugList(kubeClient kube.ExtendedClient, ...) (map[string]*xdsapi.DiscoveryResponse, error)
- type AnalyzerFoundIssuesError
- type CommandParseError
- type ControlzClient
- type ExternalInjector
- type FileParseError
- type IstioOperatorCRInfo
- type Level
- type MutatingWebhookConfigInfo
- type NsInfo
- type PodFilteredInfo
- type RevisionDescription
- type ScopeInfo
- type ScopeLevelPair
- type Workloader
Constants ¶
const ( FlagNamespace = "namespace" FlagIstioNamespace = "istioNamespace" FlagCharts = "charts" )
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.
const (
// ExperimentalMsg indicate active development and not for production use warning.
ExperimentalMsg = `THIS COMMAND IS UNDER ACTIVE DEVELOPMENT AND NOT READY FOR PRODUCTION USE.`
)
const FileParseString = "Some files couldn't be parsed."
Variables ¶
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 AnalyzersAsString ¶
func AuthZ ¶
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 GetFirstPod ¶
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 ¶
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
}
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 ScopeLevelPair ¶
type ScopeLevelPair struct {
// contains filtered or unexported fields
}
type Workloader ¶
type Workloader interface {
GetSelector() *typev1beta1.WorkloadSelector
}
Workloader is used for matching all configs
Source Files ¶
- add-to-mesh.go
- admin.go
- analyze.go
- authz.go
- clusters.go
- completion.go
- config.go
- dashboard.go
- deprecated_cmd.go
- describe.go
- google.go
- injector-list.go
- internal-debug.go
- istiodconfig.go
- kubeinject.go
- kubeuninject.go
- metrics.go
- options.go
- precheck.go
- proxyconfig.go
- proxystatus.go
- remove-from-mesh.go
- revision.go
- root.go
- sysexits.go
- tag.go
- version.go
- wait.go
- workload.go