cmd

package
v0.124.1 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2025 License: MIT Imports: 77 Imported by: 0

Documentation

Index

Constants

View Source
const (
	EndpointTypeSSH = "ssh"
	EndpointTypeSCP = "scp"
)
View Source
const (
	KubeConfigEnvVar = "KUBECONFIG"
)

Variables

View Source
var (
	ErrCompletionShellNotSpecified = errors.New("Shell not specified.")
	ErrCompletionTooMayArguments   = errors.New("Too many arguments. Expected only the shell type.")
)
View Source
var (
	ErrCompatibilityMatrixTermsNotAccepted = errors.New("You must read and accept the Compatibility Matrix Terms of Service before using this command. To view, please visit https://vendor.replicated.com/compatibility-matrix")
)
View Source
var ErrVMWaitDurationExceeded = errors.New("wait duration exceeded")
View Source
var ErrWaitDurationExceeded = errors.New("wait duration exceeded")

Functions

func Execute

func Execute(rootCmd *cobra.Command, stdin io.Reader, stdout io.Writer, stderr io.Writer) error

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

func GetRootCmd added in v0.10.0

func GetRootCmd() *cobra.Command

RootCmd represents the base command when called without any subcommands

func NewCmdCompletion added in v0.57.0

func NewCmdCompletion(out io.Writer, parentName string) *cobra.Command

func RunCompletion added in v0.57.0

func RunCompletion(out io.Writer, cmd *cobra.Command, args []string) error

func Version added in v0.11.0

func Version() *cobra.Command

Types

type ChartLintResult added in v0.117.0

type ChartLintResult struct {
	Path     string          `json:"path"`
	Success  bool            `json:"success"`
	Messages []LintMessage   `json:"messages"`
	Summary  ResourceSummary `json:"summary"`
}

ChartLintResult represents lint results for a single Helm chart

func (ChartLintResult) GetMessages added in v0.117.0

func (c ChartLintResult) GetMessages() []LintMessage

func (ChartLintResult) GetPath added in v0.117.0

func (c ChartLintResult) GetPath() string

Implement LintableResult interface for ChartLintResult

func (ChartLintResult) GetSuccess added in v0.117.0

func (c ChartLintResult) GetSuccess() bool

func (ChartLintResult) GetSummary added in v0.117.0

func (c ChartLintResult) GetSummary() ResourceSummary

type ClusterTimeoutError added in v0.107.0

type ClusterTimeoutError struct {
	Cluster  *types.Cluster
	Duration time.Duration
}

func (ClusterTimeoutError) Error added in v0.107.0

func (e ClusterTimeoutError) Error() string

type ExtractedPaths added in v0.117.0

type ExtractedPaths struct {
	// Helm: simple paths (Chart.yaml validation delegated to helm tool)
	ChartPaths []string

	// Preflight: paths with chart metadata for template rendering
	Preflights []lint2.PreflightWithValues

	// Support bundles: simple paths
	SupportBundles []string

	// Shared: HelmChart manifests (used by preflight + image extraction)
	HelmChartManifests map[string]*lint2.HelmChartManifest

	// Image extraction: charts with metadata (only if verbose)
	ChartsWithMetadata []lint2.ChartWithMetadata

	// Tool versions
	HelmVersion      string
	PreflightVersion string
	SBVersion        string

	// Metadata
	ConfigPath string
}

ExtractedPaths contains all paths and metadata needed for linting. This struct consolidates extraction logic across all linters to avoid duplication.

type HelmLintResults added in v0.117.0

type HelmLintResults struct {
	Enabled bool              `json:"enabled"`
	Charts  []ChartLintResult `json:"charts"`
}

HelmLintResults contains all Helm chart lint results

type ImageExtractResults added in v0.117.0

type ImageExtractResults struct {
	Images   []imageextract.ImageRef `json:"images"`
	Warnings []imageextract.Warning  `json:"warnings"`
	Summary  ImageSummary            `json:"summary"`
}

ImageExtractResults contains extracted image information

type ImageSummary added in v0.117.0

type ImageSummary struct {
	TotalImages  int `json:"total_images"`
	UniqueImages int `json:"unique_images"`
}

ImageSummary contains summary statistics for extracted images

type JSONLintOutput added in v0.117.0

type JSONLintOutput struct {
	Metadata             LintMetadata              `json:"metadata"`
	HelmResults          *HelmLintResults          `json:"helm_results,omitempty"`
	PreflightResults     *PreflightLintResults     `json:"preflight_results,omitempty"`
	SupportBundleResults *SupportBundleLintResults `json:"support_bundle_results,omitempty"`
	Summary              LintSummary               `json:"summary"`
	Images               *ImageExtractResults      `json:"images,omitempty"` // Only if --verbose
}

JSONLintOutput represents the complete JSON output structure for lint results

type LintMessage added in v0.117.0

type LintMessage struct {
	Severity string `json:"severity"` // ERROR, WARNING, INFO
	Path     string `json:"path,omitempty"`
	Message  string `json:"message"`
}

LintMessage represents a single lint issue (wraps lint2.LintMessage with JSON tags)

type LintMetadata added in v0.117.0

type LintMetadata struct {
	Timestamp            string `json:"timestamp"`
	ConfigFile           string `json:"config_file"`
	HelmVersion          string `json:"helm_version,omitempty"`
	PreflightVersion     string `json:"preflight_version,omitempty"`
	SupportBundleVersion string `json:"support_bundle_version,omitempty"`
	CLIVersion           string `json:"cli_version"`
}

LintMetadata contains execution context and environment information

type LintSummary added in v0.117.0

type LintSummary struct {
	TotalResources  int  `json:"total_resources"`
	PassedResources int  `json:"passed_resources"`
	FailedResources int  `json:"failed_resources"`
	TotalErrors     int  `json:"total_errors"`
	TotalWarnings   int  `json:"total_warnings"`
	TotalInfo       int  `json:"total_info"`
	OverallSuccess  bool `json:"overall_success"`
}

LintSummary contains overall statistics across all linted resources

type LintableResult added in v0.117.0

type LintableResult interface {
	GetPath() string
	GetSuccess() bool
	GetMessages() []LintMessage
	GetSummary() ResourceSummary
}

LintableResult is an interface for types that contain lint results. This allows generic handling of chart, preflight, and support bundle results.

type PreflightLintResult added in v0.117.0

type PreflightLintResult struct {
	Path     string          `json:"path"`
	Success  bool            `json:"success"`
	Messages []LintMessage   `json:"messages"`
	Summary  ResourceSummary `json:"summary"`
}

PreflightLintResult represents lint results for a single Preflight spec

func (PreflightLintResult) GetMessages added in v0.117.0

func (p PreflightLintResult) GetMessages() []LintMessage

func (PreflightLintResult) GetPath added in v0.117.0

func (p PreflightLintResult) GetPath() string

Implement LintableResult interface for PreflightLintResult

func (PreflightLintResult) GetSuccess added in v0.117.0

func (p PreflightLintResult) GetSuccess() bool

func (PreflightLintResult) GetSummary added in v0.117.0

func (p PreflightLintResult) GetSummary() ResourceSummary

type PreflightLintResults added in v0.117.0

type PreflightLintResults struct {
	Enabled bool                  `json:"enabled"`
	Specs   []PreflightLintResult `json:"specs"`
}

PreflightLintResults contains all Preflight spec lint results

type ResourceSummary added in v0.117.0

type ResourceSummary struct {
	ErrorCount   int `json:"error_count"`
	WarningCount int `json:"warning_count"`
	InfoCount    int `json:"info_count"`
}

ResourceSummary contains counts by severity for a resource

type SupportBundleLintResult added in v0.117.0

type SupportBundleLintResult struct {
	Path     string          `json:"path"`
	Success  bool            `json:"success"`
	Messages []LintMessage   `json:"messages"`
	Summary  ResourceSummary `json:"summary"`
}

SupportBundleLintResult represents lint results for a single Support Bundle spec

func (SupportBundleLintResult) GetMessages added in v0.117.0

func (s SupportBundleLintResult) GetMessages() []LintMessage

func (SupportBundleLintResult) GetPath added in v0.117.0

func (s SupportBundleLintResult) GetPath() string

Implement LintableResult interface for SupportBundleLintResult

func (SupportBundleLintResult) GetSuccess added in v0.117.0

func (s SupportBundleLintResult) GetSuccess() bool

func (SupportBundleLintResult) GetSummary added in v0.117.0

type SupportBundleLintResults added in v0.117.0

type SupportBundleLintResults struct {
	Enabled bool                      `json:"enabled"`
	Specs   []SupportBundleLintResult `json:"specs"`
}

SupportBundleLintResults contains all Support Bundle spec lint results

type VM added in v0.104.0

type VM struct {
	DirectEndpoint string
	DirectPort     int64
	ID             string
	Status         string
	Name           string
}

type VMTimeoutError added in v0.107.0

type VMTimeoutError struct {
	VMs      []*types.VM
	Duration time.Duration
}

func (VMTimeoutError) Error added in v0.107.0

func (e VMTimeoutError) Error() string

Source Files

Jump to

Keyboard shortcuts

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