modulereleases

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: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyNowModuleRelease

func ApplyNowModuleRelease(dynamicClient dynamic.Interface, releaseName string) error

ApplyNowModuleRelease adds the apply-now annotation to a module release.

func ApproveModuleRelease

func ApproveModuleRelease(dynamicClient dynamic.Interface, releaseName string) error

ApproveModuleRelease adds the approved annotation to a module release.

func CanBeAppliedNow

func CanBeAppliedNow(r ModuleReleaseInfo) bool

CanBeAppliedNow returns true for pending releases without apply-now annotation. Used by the apply-now command to filter releases available for immediate deployment.

func CanBeApproved

func CanBeApproved(r ModuleReleaseInfo) bool

CanBeApproved returns true for pending releases that are not yet approved. Used by the approve command to filter releases available for approval.

func FindVersions

func FindVersions(dynamicClient dynamic.Interface, moduleName string, match ReleaseMatchFunc) ([]string, error)

FindVersions returns a sorted list of versions for releases matching the predicate. All versions are normalized to have a "v" prefix for consistent completion.

func ListModuleNames

func ListModuleNames(dynamicClient dynamic.Interface) ([]string, error)

ListModuleNames returns a sorted list of unique module names from all releases.

func NormalizeVersion

func NormalizeVersion(version string) string

NormalizeVersion ensures the version has a 'v' prefix.

func SortReleasesByVersion

func SortReleasesByVersion(releases []ModuleReleaseInfo)

SortReleasesByVersion sorts releases by semantic version in ascending order. Falls back to lexicographic comparison if version parsing fails.

Types

type ModuleReleaseInfo

type ModuleReleaseInfo struct {
	Name       string
	ModuleName string
	Version    string
	Phase      string
	Message    string
	IsApproved bool
	IsApplyNow bool
}

ModuleReleaseInfo contains information about a module release. This is a simplified DTO for use in CLI commands.

func FindReleases

func FindReleases(dynamicClient dynamic.Interface, moduleName string, match ReleaseMatchFunc) ([]ModuleReleaseInfo, error)

FindReleases returns releases matching the given predicate, sorted by version. It's simply a filtered version of ListModuleReleases (convenience function).

func GetModuleRelease

func GetModuleRelease(dynamicClient dynamic.Interface, moduleName, version string) (*ModuleReleaseInfo, error)

GetModuleRelease returns a specific module release by module name and version.

func ListModuleReleases

func ListModuleReleases(dynamicClient dynamic.Interface, moduleName string) ([]ModuleReleaseInfo, error)

ListModuleReleases returns all module releases for a given module name. If moduleName is empty, returns all releases.

type NearestVersions

type NearestVersions struct {
	Lower *ModuleReleaseInfo // closest version below target, nil if none exists
	Upper *ModuleReleaseInfo // closest version above target, nil if none exists
}

NearestVersions contains the closest versions below and above a target version.

func FindNearestVersions

func FindNearestVersions(releases []ModuleReleaseInfo, targetVersion string) NearestVersions

FindNearestVersions finds the closest versions below and above the target version.

type ReleaseMatchFunc

type ReleaseMatchFunc func(r ModuleReleaseInfo) bool

ReleaseMatchFunc is a predicate function for filtering releases. Returns true if the release should be included in the result.

Jump to

Keyboard shortcuts

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