Documentation
¶
Index ¶
- func IsKnownFormat(v string) bool
- func IsUpdateSupported(runningVersion, minVersionUpdateSupported string) bool
- func IsValidAgentVersion(ver string) bool
- func MinApplianceVersion() string
- func SameChannel(a, b string) bool
- func SetAgentVersionName(v string)
- func SetMinApplianceVersion(v string)
- func UpdateAvailable(served, deployed string) bool
- type Info
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsKnownFormat ¶ added in v0.33.0
IsKnownFormat reports whether v parses as one of the four appliance version formats — the same validity rule UpdateAvailable uses, unlike the looser IsValidAgentVersion which accepts anything non-empty and non-"unknown".
func IsUpdateSupported ¶ added in v0.33.0
IsUpdateSupported reports whether the running appliance version can be updated in place to the served image: same channel as the minimum and not numerically older than it. Not comparable (different channel, missing numbers, invalid) gives no signal — the gate only blocks on a proven comparison, so it fails open.
func IsValidAgentVersion ¶ added in v0.8.0
IsValidAgentVersion reports whether ver is usable for agent version comparison and persistence. Empty string and "unknown" are treated as missing.
func MinApplianceVersion ¶ added in v0.33.0
func MinApplianceVersion() string
MinApplianceVersion returns the oldest appliance version the served image supports in-place updates from; empty means no gating.
func SameChannel ¶ added in v0.33.0
SameChannel reports whether both versions have a known appliance format and belong to the same release channel. Invalid versions are never comparable.
func SetAgentVersionName ¶ added in v0.33.0
func SetAgentVersionName(v string)
SetAgentVersionName overrides the served appliance version. The ldflag is unset under go test, so tests set it explicitly instead of skipping.
func SetMinApplianceVersion ¶ added in v0.33.0
func SetMinApplianceVersion(v string)
SetMinApplianceVersion overrides the in-place update minimum for tests.
func UpdateAvailable ¶ added in v0.33.0
UpdateAvailable reports whether the served appliance version differs from the deployed one per the channel-aware rule: any difference within a channel (numbers or sha) is an update; anything not comparable gives no signal. The served version is only ever what the SaaS distributes, so a differing sha means the served generation is newer.
Types ¶
type Info ¶
type Info struct {
Major string `json:"major"`
Minor string `json:"minor"`
GitVersion string `json:"gitVersion"`
GitCommit string `json:"gitCommit"`
GitTreeState string `json:"gitTreeState"`
BuildDate string `json:"buildDate"`
GoVersion string `json:"goVersion"`
Compiler string `json:"compiler"`
Platform string `json:"platform"`
Patch string `json:"patch"`
AgentGitCommit string `json:"agentGitCommit"`
AgentVersionName string `json:"agentVersionName"`
MinApplianceVersion string `json:"minApplianceVersion"`
}