From 1dd2367eba94574c87cd5de60e77318c98495264 Mon Sep 17 00:00:00 2001 From: "austin.barrington" Date: Wed, 1 Jul 2026 10:35:50 +0100 Subject: [PATCH] fix: strip "v" prefix from image tags and set default proxy registry - NormalizeVersionTag now strips leading "v" instead of adding it - Default proxy repo set to ghcr.io/hyperbyte-cloud/hyperbytedb-proxy - Update ProxySpec.Image CRD default to match published registry - Regenerate CRDs, install.yaml, and Helm chart templates --- .github/workflows/release.yml | 4 ++-- api/v1alpha1/hyperbytedbcluster_types.go | 4 ++-- ...bytedb.hyperbyte.cloud_hyperbytedbclusters.yaml | 4 ++-- config/manager/kustomization.yaml | 4 ++-- ...bytedbclusters.hyperbytedb.hyperbyte.cloud.yaml | 4 ++-- dist/chart/values.yaml | 2 +- dist/install.yaml | 4 ++-- internal/hyperbytedb/image.go | 8 +++----- internal/hyperbytedb/image_test.go | 14 +++++++------- 9 files changed, 23 insertions(+), 25 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ee4f85e..8bcd00c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -47,10 +47,10 @@ jobs: if [ "${{ github.ref_type }}" = "tag" ]; then TAG="${{ github.ref_name }}" # e.g. v0.1.2 CHART_VERSION="${TAG#v}" # 0.1.2 (chart/app versions are semver, no leading v) - IMAGE_TAG="$TAG" # v0.1.2 + IMAGE_TAG="$CHART_VERSION" # 0.1.2 else CHART_VERSION="${{ inputs.version }}" - IMAGE_TAG="v${{ inputs.version }}" + IMAGE_TAG="${{ inputs.version }}" fi echo "chart_version=$CHART_VERSION" >> "$GITHUB_OUTPUT" echo "image_tag=$IMAGE_TAG" >> "$GITHUB_OUTPUT" diff --git a/api/v1alpha1/hyperbytedbcluster_types.go b/api/v1alpha1/hyperbytedbcluster_types.go index c74fa35..b18f109 100644 --- a/api/v1alpha1/hyperbytedbcluster_types.go +++ b/api/v1alpha1/hyperbytedbcluster_types.go @@ -36,7 +36,7 @@ type HyperbytedbClusterSpec struct { Image string `json:"image,omitempty"` // Application version. Drives the container image tag for hyperbytedb and - // hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:v0.8.3). Changing + // hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:0.8.3). Changing // this field triggers a rolling upgrade. // +optional Version string `json:"version,omitempty"` @@ -455,7 +455,7 @@ type ProxySpec struct { // +kubebuilder:default=true Enabled bool `json:"enabled"` - // +kubebuilder:default="hyperbytedb-proxy:latest" + // +kubebuilder:default="ghcr.io/hyperbyte-cloud/hyperbytedb-proxy" Image string `json:"image,omitempty"` // +optional diff --git a/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml b/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml index e28f9e4..e89299b 100644 --- a/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml +++ b/config/crd/bases/hyperbytedb.hyperbyte.cloud_hyperbytedbclusters.yaml @@ -3289,7 +3289,7 @@ spec: minimum: 0 type: integer image: - default: hyperbytedb-proxy:latest + default: ghcr.io/hyperbyte-cloud/hyperbytedb-proxy type: string imagePullPolicy: description: PullPolicy describes a policy for if/when to pull @@ -3829,7 +3829,7 @@ spec: version: description: |- Application version. Drives the container image tag for hyperbytedb and - hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:v0.8.3). Changing + hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:0.8.3). Changing this field triggers a rolling upgrade. type: string type: object diff --git a/config/manager/kustomization.yaml b/config/manager/kustomization.yaml index 380704c..ad13e96 100644 --- a/config/manager/kustomization.yaml +++ b/config/manager/kustomization.yaml @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization images: - name: controller - newName: hyperbytedb-operator - newTag: dev + newName: controller + newTag: latest diff --git a/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml b/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml index 8fa66df..61905e4 100644 --- a/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml +++ b/dist/chart/templates/crd/hyperbytedbclusters.hyperbytedb.hyperbyte.cloud.yaml @@ -3292,7 +3292,7 @@ spec: minimum: 0 type: integer image: - default: hyperbytedb-proxy:latest + default: ghcr.io/hyperbyte-cloud/hyperbytedb-proxy type: string imagePullPolicy: description: PullPolicy describes a policy for if/when to pull @@ -3832,7 +3832,7 @@ spec: version: description: |- Application version. Drives the container image tag for hyperbytedb and - hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:v0.8.3). Changing + hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:0.8.3). Changing this field triggers a rolling upgrade. type: string type: object diff --git a/dist/chart/values.yaml b/dist/chart/values.yaml index 45a8a70..15fcdcd 100644 --- a/dist/chart/values.yaml +++ b/dist/chart/values.yaml @@ -14,7 +14,7 @@ manager: image: repository: ghcr.io/hyperbyte-cloud/hyperbytedb-operator # Leave empty to track the chart's appVersion (recommended). Override to - # pin to a specific tag, e.g. tag: "v0.2.0". + # pin to a specific tag, e.g. tag: "0.2.0". tag: "" pullPolicy: IfNotPresent diff --git a/dist/install.yaml b/dist/install.yaml index 4ef7384..e5fe979 100644 --- a/dist/install.yaml +++ b/dist/install.yaml @@ -3492,7 +3492,7 @@ spec: minimum: 0 type: integer image: - default: hyperbytedb-proxy:latest + default: ghcr.io/hyperbyte-cloud/hyperbytedb-proxy type: string imagePullPolicy: description: PullPolicy describes a policy for if/when to pull @@ -4032,7 +4032,7 @@ spec: version: description: |- Application version. Drives the container image tag for hyperbytedb and - hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:v0.8.3). Changing + hyperbytedb-proxy (e.g. version "0.8.3" → hyperbytedb:0.8.3). Changing this field triggers a rolling upgrade. type: string type: object diff --git a/internal/hyperbytedb/image.go b/internal/hyperbytedb/image.go index e86416c..c8ed340 100644 --- a/internal/hyperbytedb/image.go +++ b/internal/hyperbytedb/image.go @@ -9,20 +9,18 @@ import ( const ( defaultHyperbytedbRepo = "hyperbytedb" - defaultProxyRepo = "hyperbytedb-proxy" + defaultProxyRepo = "ghcr.io/hyperbyte-cloud/hyperbytedb-proxy" defaultImageTag = "latest" ) // NormalizeVersionTag maps a semver-ish version string to an OCI image tag. -// "0.8.3" and "v0.8.3" both become "v0.8.3" to match published container tags. +// "0.8.3" and "v0.8.3" both become "0.8.3". func NormalizeVersionTag(version string) string { v := strings.TrimSpace(version) if v == "" { return defaultImageTag } - if !strings.HasPrefix(v, "v") { - v = "v" + v - } + v = strings.TrimPrefix(v, "v") return v } diff --git a/internal/hyperbytedb/image_test.go b/internal/hyperbytedb/image_test.go index cd12095..5b8f911 100644 --- a/internal/hyperbytedb/image_test.go +++ b/internal/hyperbytedb/image_test.go @@ -12,9 +12,9 @@ func TestNormalizeVersionTag(t *testing.T) { want string }{ {"", "latest"}, - {"0.8.3", "v0.8.3"}, - {"v0.8.3", "v0.8.3"}, - {" 1.0.0 ", "v1.0.0"}, + {"0.8.3", "0.8.3"}, + {"v0.8.3", "0.8.3"}, + {" 1.0.0 ", "1.0.0"}, } for _, tc := range tests { if got := NormalizeVersionTag(tc.in); got != tc.want { @@ -38,9 +38,9 @@ func TestResolveHyperbytedbImage(t *testing.T) { c *v1alpha1.HyperbytedbCluster want string }{ - {"version only", cluster("", "0.8.3"), "hyperbytedb:v0.8.3"}, + {"version only", cluster("", "0.8.3"), "hyperbytedb:0.8.3"}, {"explicit tag wins", cluster("hyperbytedb:local", "0.8.3"), "hyperbytedb:local"}, - {"repo plus version", cluster("ghcr.io/org/hyperbytedb", "0.8.3"), "ghcr.io/org/hyperbytedb:v0.8.3"}, + {"repo plus version", cluster("ghcr.io/org/hyperbytedb", "0.8.3"), "ghcr.io/org/hyperbytedb:0.8.3"}, {"default latest", cluster("", ""), "hyperbytedb:latest"}, } for _, tc := range tests { @@ -59,8 +59,8 @@ func TestResolveProxyImage(t *testing.T) { Proxy: &v1alpha1.ProxySpec{}, }, } - if got := ResolveProxyImage(c); got != "hyperbytedb-proxy:v0.8.3" { - t.Fatalf("ResolveProxyImage() = %q, want hyperbytedb-proxy:v0.8.3", got) + if got := ResolveProxyImage(c); got != "ghcr.io/hyperbyte-cloud/hyperbytedb-proxy:0.8.3" { + t.Fatalf("ResolveProxyImage() = %q, want ghcr.io/hyperbyte-cloud/hyperbytedb-proxy:0.8.3", got) } c.Spec.Proxy.Image = "hyperbytedb-proxy:local"