latest_version

package
v0.97.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:     "latest-version",
	Short:   "Get latest version of a Helm chart from a repository",
	Aliases: []string{"lv"},
	Args:    cobra.NoArgs,
	Run: func(c *cobra.Command, args []string) {

		if strings.HasPrefix(FlagRepo, "oci://") {
			ociURL := FlagRepo + "/" + FlagChart
			version, err := helm_utils.GetLatestVersionFromOCI(ociURL)
			error_utils.HandleError(err, "Error getting latest version from OCI registry")
			fmt.Println(version)
			return
		}

		repoName := FlagRepo

		if strings.HasPrefix(FlagRepo, "http://") || strings.HasPrefix(FlagRepo, "https://") {
			name, err := helm_utils.GetRepoNameFromURL(FlagRepo)
			error_utils.HandleError(err, "Error finding repository by URL")
			repoName = name
		}

		version, err := helm_utils.GetLatestVersionFromRepo(repoName, FlagChart)
		error_utils.HandleError(err, "Error getting latest version from repository")

		fmt.Println(version)
	},
}
View Source
var FlagChart string
View Source
var FlagRepo string

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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