update

package
v0.8.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2026 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyUpgrades

func ApplyUpgrades(cfg *config.Config, u *ui.UI, opts UpgradeOptions) error

ApplyUpgrades runs helmfile sync on defaults and all installed deployments.

func CompareVersions

func CompareVersions(current, latest string) int

CompareVersions compares two semver strings (without "v" prefix). Returns -1 if current < latest, 0 if equal, +1 if current > latest.

func HintIfStale

func HintIfStale(cfg *config.Config)

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

func MajorVersion(v string) int

MajorVersion extracts the major version number from a semver string.

func ParseHelmfileReleasesFromBytes

func ParseHelmfileReleasesFromBytes(data []byte) ([]helmfileRelease, error)

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

func ResolveReleaseNames(cfg *config.Config, filter string) []string

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.

func UpdateHelmRepos

func UpdateHelmRepos(cfg *config.Config, quiet bool) error

UpdateHelmRepos runs `helm repo update` to refresh all repo indexes. If quiet is true, stdout is suppressed (useful for JSON output mode).

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

func CheckForUpdates(cfg *config.Config, clusterRunning bool, quiet bool) (*UpdateResult, error)

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

type VersionBump struct {
	Chart string
	From  string
	To    string
}

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.

Jump to

Keyboard shortcuts

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