Version reference
Status: Implemented Issue: https://gitlab.com/gitlab-org/cloud-native/gitlab-operator/-/work_items/2255 Parent: none
Goal
A platform that ships a tested set of components sets the exact chart version of a GitLabCore or
a Siphon in an object it owns, while the owner of the resource keeps owning its spec.
Requirements
- A
Siphonselects its chart version inspec.version, shaped like the one of aGitLabCore, with theStatictype only.spec.chartcarries the values only. - A
Staticversion of either resource takes its version fromversion, or fromversionRef, which names akind, aname, and akey. The only kind isConfigMap, read from the namespace of the resource. - A version with both
versionandversionRef, or with neither, is rejected. So is aGitLabCoreversionRefon a type other thanStatic, and aSiphontype other thanStatic. - The referenced version behaves exactly as the literal one: a
GitLabCoreruns it, upgrades when it changes, and refuses a downgrade, and aSiphonrenders that chart version. - A change to the referenced ConfigMap, including its creation, reconciles every resource in the namespace that references it, with no change to the resource.
- A missing ConfigMap or key, or a value that is not a semantic version, fails the pass of a
Siphon, and of aGitLabCorewith no target yet, withInitialized=Falseand reasonVersionUnresolved. AGitLabCorewith a target keeps it, an upgrade in progress included, and reportsUpgradeable=Falsewith the same reason. Neither deletes what it already applied. - Replacing
versionRefwith a literal version, or the reverse, is an ordinary change of the version, so aGitLabCorethat switches back to a reference that lags refuses it as a downgrade. - The bridge API reads and writes
versionRefon both resources, and its web UI keeps a reference it loaded until a version is typed in its place.
Out of scope
- A
Secretas the source of a version. - A reference to an object in another namespace.
- A reference for the types that follow the chart repository, such as a minor or a major.
Siphontypes other thanStatic, and a downgrade refusal forSiphon.- Editing a reference in the web UI.
FAQ
- Why only
ConfigMap? A version is not secret, and reading Secrets widens what the Operator watches. Thekindfield leaves room to addSecretwithout breaking the API. - Why only the
Statictype? The other types already move without a change to the spec. A platform that wants to pin a version usesStatic. - Why does a
Siphonhavespec.versionwith a single type? It followsGitLabCore, so both resources select a version the same way. ASiphonchart is never pulled, so there is no repository to follow, andStaticis the only type that makes sense today. The union leaves room for more. - Can the owner take control back? Yes. Replacing
versionRefwithversionpicks up any version at once, for example a fix ahead of the platform. - Does the Operator write the referenced version into the spec? No, for the reason
Unattended upgrades gives. A
GitLabCorereports it instatus.targetVersion, and aSiphoninstatus.versiononce applied.
Was this page helpful?