Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ resolver = "3"
# CLI so they always publish in lockstep. `just bump X.Y.Z` rewrites this; the
# version-consistency gate enforces tag == this == Chart.yaml at release time.
[workspace.package]
version = "0.35.0"
version = "0.37.0"
edition = "2024"
rust-version = "1.94.1"
license = "Apache-2.0"
Expand Down
4 changes: 2 additions & 2 deletions charts/kobe/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ description: >-
Kubernetes operator for instant cluster provisioning via warm pools.
Supports multiple backends: k3s, k0s, CAPI, and kobe-sync.
type: application
version: 0.21.19
appVersion: "0.35.0"
version: 0.37.0
appVersion: "0.37.0"
keywords:
- kubernetes
- operator
Expand Down
13 changes: 9 additions & 4 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ coverage-open:
clean:
cargo clean

# Bump the release version across the workspace + Chart.yaml appVersion in
# lockstep, then verify consistency. Usage: just bump 0.32.0 (or 0.32.0-rc.1)
# Bump the release version across the workspace + Chart.yaml version and
# appVersion in lockstep, then verify consistency. The chart ships with the
# operator on the same `v*` tag, so all three move together — a chart-only fix
# is a patch release of the whole thing, NOT a `-1` suffix (semver reads that as
# a prerelease, so it would sort BELOW the release it fixes and be hidden from
# `helm search` / dependency resolution). Usage: just bump 0.32.0 (or 0.32.0-rc.1)
[group('release')]
bump VERSION:
#!/usr/bin/env bash
Expand All @@ -165,9 +169,10 @@ bump VERSION:
fi
# Sets [workspace.package].version; both kobe-operator and kobectl inherit.
cargo set-version --workspace "{{ VERSION }}"
# Mirror into the chart's appVersion (the chart's own `version:` is decoupled
# and bumped separately when the chart itself changes).
# Mirror into the chart's appVersion AND its own `version:` — the chart is
# published from the same release tag, so both track the operator version.
perl -i -pe 's/^appVersion:.*$/appVersion: "{{ VERSION }}"/' charts/kobe/Chart.yaml
perl -i -pe 's/^version:.*$/version: {{ VERSION }}/' charts/kobe/Chart.yaml
cargo update -p kobe-operator -p kobectl --precise "{{ VERSION }}" 2>/dev/null || true
./scripts/check-version-consistency.sh
echo "Bumped to {{ VERSION }}. Review the diff, commit, then \`just release\`."
Expand Down
24 changes: 18 additions & 6 deletions scripts/check-version-consistency.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,16 @@
# (`[workspace.package].version`), inherited by both `kobe-operator` and the
# published `kobectl` crate. The places that must mirror it:
# - charts/kobe/Chart.yaml `appVersion` (the app/operator release version)
# - charts/kobe/Chart.yaml `version` (the chart ships on the same tag)
# - nix/package.nix `version` (only if the file exists)
#
# NOTE: the chart's own `version:` is INTENTIONALLY decoupled — kobe versions the
# Helm chart on its own track (e.g. chart 0.21.x while appVersion is 0.31.x), so
# it is deliberately NOT gated here.
# NOTE: the chart's own `version:` used to be on its own track (chart 0.21.x while
# appVersion was 0.31.x). As of 0.36.0 the chart is published from the same `v*`
# release tag as the image, so it is gated here too and `just bump` moves both.
# A chart-only fix is therefore a patch release of the whole thing — NOT a
# `X.Y.Z-1` suffix, which semver reads as a PRERELEASE of X.Y.Z (it sorts below
# the release it means to fix, and helm hides it from search / dependency
# resolution without --devel).
# The binary's --version comes from BUILD_VERSION=<tag> at build time; the tag is
# a checked mirror of the manifest.
#
Expand Down Expand Up @@ -76,13 +81,20 @@ def chart_field(name):
mm = re.search(rf'(?m)^{name}:\s*"?([^"\s]+)"?\s*$', chart)
return mm.group(1) if mm else None

# Only appVersion is gated; the chart's own `version:` is decoupled on purpose.
chart_appversion = chart_field("appVersion")
if chart_appversion is None:
errors.append("charts/kobe/Chart.yaml has no `appVersion:`")
elif chart_appversion != ws_version:
errors.append(f"Chart.yaml appVersion {chart_appversion!r} != workspace version {ws_version!r}")

# The chart is published from the same release tag, so its own `version:` tracks
# the operator version too.
chart_version = chart_field("version")
if chart_version is None:
errors.append("charts/kobe/Chart.yaml has no `version:`")
elif chart_version != ws_version:
errors.append(f"Chart.yaml version {chart_version!r} != workspace version {ws_version!r}")

# --- nix/package.nix version (optional) ---
nix_pkg = root / "nix" / "package.nix"
if nix_pkg.exists():
Expand All @@ -104,7 +116,7 @@ if errors:
sys.exit(1)

if tag_version:
print(f"version consistency OK: tag {tag_version} == workspace == Chart.yaml appVersion")
print(f"version consistency OK: tag {tag_version} == workspace == Chart.yaml version + appVersion")
else:
print(f"version consistency OK: workspace == Chart.yaml appVersion == {ws_version}")
print(f"version consistency OK: workspace == Chart.yaml version + appVersion == {ws_version}")
PY
Loading