Documentation
¶
Index ¶
- func ApplyUpgrades(cfg *config.Config, u *ui.UI, opts UpgradeOptions) error
- func CompareVersions(current, latest string) int
- func HintIfStale(cfg *config.Config)
- func MajorVersion(v string) int
- func ParseHelmfileReleasesFromBytes(data []byte) ([]helmfileRelease, error)
- func PrintCLIStatus(u *ui.UI, current string, release *LatestRelease, isDev bool)
- func PrintUpdateSummary(u *ui.UI, result *UpdateResult)
- func PrintUpdateTable(u *ui.UI, statuses []ChartStatus)
- func ResolveReleaseNames(cfg *config.Config, filter string) []string
- func UpdateHelmRepos(cfg *config.Config, quiet bool) error
- type ChartStatus
- type LatestRelease
- type UpdateResult
- type UpgradeOptions
- type VersionBump
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ApplyUpgrades ¶
ApplyUpgrades runs helmfile sync on defaults and all installed deployments.
func CompareVersions ¶
CompareVersions compares two semver strings (without "v" prefix). Returns -1 if current < latest, 0 if equal, +1 if current > latest.
func HintIfStale ¶
HintIfStale compares embedded helmfile chart versions against the on-disk deployed versions. If any embedded version is newer than on-disk, prints a one-line hint suggesting `obol upgrade`. This is best-effort and never errors.
func MajorVersion ¶
MajorVersion extracts the major version number from a semver string.
func ParseHelmfileReleasesFromBytes ¶
ParseHelmfileReleasesFromBytes extracts release entries from helmfile YAML bytes. Exported for use by the hint system to parse embedded helmfile content.
func PrintCLIStatus ¶
func PrintCLIStatus(u *ui.UI, current string, release *LatestRelease, isDev bool)
PrintCLIStatus prints the CLI version status line.
func PrintUpdateSummary ¶
func PrintUpdateSummary(u *ui.UI, result *UpdateResult)
PrintUpdateSummary prints the actionable summary at the end of `obol update`.
func PrintUpdateTable ¶
func PrintUpdateTable(u *ui.UI, statuses []ChartStatus)
PrintUpdateTable prints a formatted table of chart statuses.
func ResolveReleaseNames ¶ added in v0.8.1
ResolveReleaseNames parses the defaults helmfile and returns the release names that match the given filter (by release name or chart name). Returns nil if no matches are found.
Types ¶
type ChartStatus ¶
type ChartStatus struct {
Chart string // e.g., "traefik/traefik"
Pinned string // Currently pinned version, e.g., "38.0.2"
Latest string // Latest available in repo
Status string // "Up to date", "Update available", "Local chart", "Unpinned"
}
ChartStatus represents the update status of a single helm chart
func CheckChartVersions ¶
func CheckChartVersions(cfg *config.Config) ([]ChartStatus, error)
CheckChartVersions parses all on-disk helmfiles (defaults + application instances) for pinned chart versions and compares each against the latest available via `helm search repo`.
type LatestRelease ¶
type LatestRelease struct {
TagName string // e.g., "v0.2.0"
Version string // e.g., "0.2.0" (tag stripped of leading "v")
URL string // HTML URL to the release page
}
LatestRelease holds info about the latest GitHub release
func CheckLatestRelease ¶
func CheckLatestRelease() (*LatestRelease, error)
CheckLatestRelease queries GitHub API for the latest obol-stack release.
type UpdateResult ¶
type UpdateResult struct {
HelmRepoUpdated bool
ChartStatuses []ChartStatus
CLIRelease *LatestRelease
CLIUpdateAvail bool
ChartUpdatesAvail bool
ChartMajorUpdatesAvail bool
IsDev bool
HelmError string
CLIError string
}
UpdateResult holds the complete results of an update check
func CheckForUpdates ¶
CheckForUpdates runs all update checks and returns a unified result. If clusterRunning is false, skips helm-related checks and only checks CLI version. If quiet is true, suppresses helm stdout (useful for JSON output mode).
type UpgradeOptions ¶ added in v0.8.1
type UpgradeOptions struct {
DefaultsOnly bool // Only upgrade default infrastructure, skip networks and apps
Pinned bool // Deploy only the versions embedded in the binary
Major bool // Allow upgrading across major version boundaries
ChartFilter string // If non-empty, only bump this chart (e.g. "obol/remote-signer")
}
UpgradeOptions controls the behaviour of ApplyUpgrades.
type VersionBump ¶
VersionBump records a single chart version change made by UpgradeHelmfileVersions.
func UpgradeHelmfileVersions ¶
func UpgradeHelmfileVersions(cfg *config.Config, major bool, chartFilter string) ([]VersionBump, error)
UpgradeHelmfileVersions rewrites version pins in all on-disk helmfiles (defaults + application instances) to the latest available versions from helm repos. Uses yaml.Node to preserve comments and formatting. If major is false, only bumps within the same major version (like npm's ^ behavior). If chartFilter is non-empty, only the matching chart is bumped. Returns the list of charts that were bumped.