Skip to content
Merged
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 .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 2 additions & 2 deletions api/v1alpha1/hyperbytedbcluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"`
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
images:
- name: controller
newName: hyperbytedb-operator
newTag: dev
newName: controller
newTag: latest
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/chart/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions dist/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
8 changes: 3 additions & 5 deletions internal/hyperbytedb/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down
14 changes: 7 additions & 7 deletions internal/hyperbytedb/image_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand All @@ -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"
Expand Down
Loading