Documentation
¶
Overview ¶
Package ocversion knows which OpenCloud versions this plugin is tested against. The pins live in versions.yaml next to this file — the one place in the repository that names an OpenCloud image (compatibility-policy.md §3). The test fixture, CI and the README all derive from it, and the file is embedded so the build carries the window it was tested in.
Index ¶
Constants ¶
const ( ChannelProduction = "production" ChannelRolling = "rolling" )
Channels OpenCloud publishes on that a leg may belong to. They decide the image a leg pulls and whether its line's later patches are covered; the support range itself is by version number. LTS is out of scope (compatibility-policy.md §3).
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Info ¶
type Info struct {
// Version is the release as OpenCloud reports it ("8.1.0"). Kept as a
// string: a development build need not be MAJOR.MINOR.PATCH, and it
// should still be logged as it is.
Version string
// Edition is "stable" on the Production channel and "rolling" on Rolling.
Edition string
}
Info is what an OpenCloud instance says about itself.
type Leg ¶
type Leg struct {
// Name is the leg's role ("newest"), stable across version bumps
// so CI job names can be required by a ruleset.
Name string `yaml:"name"`
Channel string `yaml:"channel"`
Image string `yaml:"image"`
Tag string `yaml:"tag"`
// Digest pins the image; empty only for the canary, which follows its tag.
Digest string `yaml:"digest"`
}
Leg is one OpenCloud version the plugin is tested against.
type Monitor ¶
type Monitor struct {
// contains filtered or unexported fields
}
Monitor keeps track of the OpenCloud version and warns when it is outside the window compiled into the build. It never refuses anything: a household that upgraded OpenCloud a day before the plugin caught up must still get its nightly backup (compatibility-policy.md §3, "warns and runs").
func NewMonitor ¶
NewMonitor returns a monitor that has not checked yet.
func (*Monitor) Check ¶
Check asks OpenCloud once and logs the result. A failed fetch keeps the last known version: a transient outage says nothing about the version.
type Pins ¶
type Pins struct {
// Default is the leg the fixture starts when none is chosen.
Default string `yaml:"default"`
// Legs are the supported versions; CI runs every one of them, blocking.
Legs []Leg `yaml:"legs"`
// Canary follows the newest release by tag and is not supported.
Canary Leg `yaml:"canary"`
}
Pins is the parsed versions.yaml.
func Embedded ¶
Embedded returns the pins compiled into this build. The file is validated by the package's tests, so an error here means a broken build.
func (Pins) SupportedSentence ¶
SupportedSentence is the README's claim, generated so it cannot drift from what CI runs.
type Status ¶
type Status struct {
// Known is false until OpenCloud has answered once.
Known bool
Version string
Edition string
// InWindow is false for a version outside Window and for one that is not
// MAJOR.MINOR.PATCH (a development or pre-release build was not tested).
InWindow bool
// Window is what this build was tested against.
Window Window
}
Status is the monitor's latest answer.
type StatusSource ¶
StatusSource reads GET <BaseURL>/status.php. Measured in the Phase 9 spike (phase-0-findings.md) on 7.2.4, 7.3.0, 7.5.0 and 8.1.0: it needs no credential, and `productversion` / `edition` carry the release on all of them. `version` and `versionstring` are a frozen ownCloud-compat "0.1.0" and are ignored.
type Version ¶
type Version struct{ Major, Minor, Patch int }
Version is an OpenCloud release number, MAJOR.MINOR.PATCH.
func ParseVersion ¶
ParseVersion reads "8.1.0" (a leading "v" is accepted). Pre-release and build suffixes are refused: no leg pins one, and a canary on one is not a supported version anyway.
type Window ¶
type Window struct {
Oldest Version
Newest Version
// ProductionLines are MAJOR.MINOR pairs; Patch is ignored.
ProductionLines []Version
}
Window is the set of OpenCloud versions a build supports (compatibility-policy.md §3): every release from the oldest to the newest Rolling leg, plus every patch release of the Production lines a leg pins.
Inside the range the channel does not matter: a Production release is a Rolling release OpenCloud kept patching on a side branch. The Production line is added on its own because those patches can be newer than the newest Rolling leg, and because the line stays supported while it is current even once it is older than the two majors the range spans.
A release newer than the newest leg is outside, even a patch release of it: supported means tested, and it was not.