cli

package
v0.26.4 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	MsgInfo  = color.New(color.FgGreen).Sprint("[INFO]")
	MsgWarn  = color.New(color.FgYellow).Sprint("[WARN]")
	MsgError = color.New(color.FgRed).Sprint("[ERROR]")
)

Output message prefixes with colors for better status readability.

Functions

func CompleteForApplyNow

func CompleteForApplyNow(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteForApplyNow provides shell completion for the apply-now command. It suggests pending releases that don't have the apply-now annotation.

func CompleteForApprove

func CompleteForApprove(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)

CompleteForApprove provides shell completion for the approve command. It suggests pending releases that are not yet approved.

func GetDynamicClient

func GetDynamicClient(cmd *cobra.Command) (dynamic.Interface, error)

GetDynamicClient creates a dynamic Kubernetes client from cobra command flags. It reads "kubeconfig" and "context" flags from the command. Dynamic client is required to work with Custom Resources like ModuleRelease and ModuleConfig, which don't have typed clients in client-go.

func PrintNearestVersionSuggestions

func PrintNearestVersionSuggestions(releases []modulereleases.ModuleReleaseInfo, targetVersion string)

PrintNearestVersionSuggestions prints suggestions for nearest versions.

func PrintNoReleasesHelp

func PrintNoReleasesHelp(dynamicClient dynamic.Interface, moduleName string)

PrintNoReleasesHelp prints help when no pending releases are found.

func PrintPendingReleases

func PrintPendingReleases(releases []modulereleases.ModuleReleaseInfo)

PrintPendingReleases prints a list of available pending releases.

func PrintSimilarModules

func PrintSimilarModules(dynamicClient dynamic.Interface, moduleName string)

PrintSimilarModules prints modules with similar names to help with typos.

func ReleaseNotFoundError

func ReleaseNotFoundError(moduleName, version string) error

ReleaseNotFoundError returns a formatted error for a missing release.

func SuggestSuitableReleasesOnNotFound

func SuggestSuitableReleasesOnNotFound(dynamicClient dynamic.Interface, moduleName, version string, match modulereleases.ReleaseMatchFunc) error

SuggestSuitableReleasesOnNotFound prints helpful suggestions when a release is not found. It can suggest releases that are available for the given match predicate.

For example, all the releases that are in Pending phase and not yet approved. You can select any rule with the ReleaseMatchFunc predicate.

Types

This section is empty.

Jump to

Keyboard shortcuts

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