Documentation
¶
Index ¶
- Variables
- func CompleteForApplyNow(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func CompleteForApprove(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective)
- func GetDynamicClient(cmd *cobra.Command) (dynamic.Interface, error)
- func PrintNearestVersionSuggestions(releases []modulereleases.ModuleReleaseInfo, targetVersion string)
- func PrintNoReleasesHelp(dynamicClient dynamic.Interface, moduleName string)
- func PrintPendingReleases(releases []modulereleases.ModuleReleaseInfo)
- func PrintSimilarModules(dynamicClient dynamic.Interface, moduleName string)
- func ReleaseNotFoundError(moduleName, version string) error
- func SuggestSuitableReleasesOnNotFound(dynamicClient dynamic.Interface, moduleName, version string, ...) error
Constants ¶
This section is empty.
Variables ¶
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 ¶
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 ¶
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 ¶
PrintSimilarModules prints modules with similar names to help with typos.
func ReleaseNotFoundError ¶
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.