From 92cfaf4f2d6f494c719d57919cc468186d87f2e9 Mon Sep 17 00:00:00 2001 From: Zhiqiang ZHOU Date: Wed, 22 Jul 2026 22:54:51 -0700 Subject: [PATCH] feat: sync default images from upstream supabase Consolidate default image constants into api/v1alpha1 as single source of truth. Webhook defaults and kubebuilder markers were already out of sync (gotrue v2.180.0 vs v2.177.0). CRD schema defaults apply before the mutating webhook, so the stale marker values silently won. Add hack/sync-upstream-images.sh and a weekly workflow that pulls versions from upstream docker-compose.yml and opens a PR gated by the existing e2e suite. --- .github/workflows/sync-upstream-images.yaml | 60 +++++++++++ api/v1alpha1/supabaseproject_types.go | 10 +- api/v1alpha1/supabaseproject_types_test.go | 14 +-- api/v1alpha1/wellknown_images.go | 24 +++++ hack/sync-upstream-images.sh | 100 ++++++++++++++++++ .../supabase.strrl.dev_supabaseprojects.yaml | 10 +- internal/component/auth.go | 3 +- internal/component/database_init.go | 3 +- internal/component/kong.go | 3 +- internal/component/meta.go | 3 +- internal/component/postgrest.go | 3 +- internal/component/realtime.go | 3 +- internal/component/resources_test.go | 13 ++- internal/component/storage.go | 3 +- internal/component/studio.go | 3 +- internal/webhook/supabaseproject_webhook.go | 14 +-- internal/webhook/wellknown_supabase_images.go | 14 --- 17 files changed, 222 insertions(+), 61 deletions(-) create mode 100644 .github/workflows/sync-upstream-images.yaml create mode 100644 api/v1alpha1/wellknown_images.go create mode 100755 hack/sync-upstream-images.sh delete mode 100644 internal/webhook/wellknown_supabase_images.go diff --git a/.github/workflows/sync-upstream-images.yaml b/.github/workflows/sync-upstream-images.yaml new file mode 100644 index 0000000..670b46b --- /dev/null +++ b/.github/workflows/sync-upstream-images.yaml @@ -0,0 +1,60 @@ +name: Sync Upstream Images + +# Weekly job that pulls component image versions from the upstream Supabase +# compose file and opens a PR when anything changed. The existing e2e +# workflow on the PR acts as the compatibility gate for version bumps. +# +# Note: PRs created with the default GITHUB_TOKEN do not trigger other +# workflows (lint, test, e2e). Configure a SYNC_UPSTREAM_TOKEN secret with +# a PAT (repo scope) so CI runs on the sync PRs automatically. Without it +# the job falls back to GITHUB_TOKEN and CI must be triggered by closing +# and reopening the PR. + +on: + schedule: + - cron: "0 3 * * 1" + workflow_dispatch: {} + +permissions: + contents: write + pull-requests: write + +jobs: + sync: + runs-on: ubuntu-latest + steps: + - name: Clone the code + uses: actions/checkout@v4 + + - name: Setup Go + uses: actions/setup-go@v5 + with: + go-version-file: go.mod + + - name: Sync image versions from upstream + run: ./hack/sync-upstream-images.sh + + - name: Regenerate CRD schema and run tests + run: make test + + - name: Create pull request + uses: peter-evans/create-pull-request@v7 + with: + token: ${{ secrets.SYNC_UPSTREAM_TOKEN || secrets.GITHUB_TOKEN }} + branch: chore/sync-upstream-images + commit-message: "chore: sync component image versions from upstream Supabase" + title: "chore: sync component image versions from upstream Supabase" + body: | + Automated sync of default component image versions from the + upstream Supabase compose file: + https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml + + Updated files: + - `api/v1alpha1/wellknown_images.go` + - `api/v1alpha1/supabaseproject_types.go` + - `helm/supabase-operator/crds/` (regenerated) + + Please review the version changes and make sure the e2e workflow + passes before merging. Major version jumps (for example Kong) + may need manual config changes in the component builders. + delete-branch: true diff --git a/api/v1alpha1/supabaseproject_types.go b/api/v1alpha1/supabaseproject_types.go index f8d1600..d062071 100644 --- a/api/v1alpha1/supabaseproject_types.go +++ b/api/v1alpha1/supabaseproject_types.go @@ -117,7 +117,7 @@ type KongConfig struct { } type AuthConfig struct { - // +kubebuilder:default="supabase/gotrue:v2.177.0" + // +kubebuilder:default="supabase/gotrue:v2.180.0" // +optional Image string `json:"image,omitempty"` @@ -141,7 +141,7 @@ type AuthConfig struct { } type RealtimeConfig struct { - // +kubebuilder:default="supabase/realtime:v2.34.47" + // +kubebuilder:default="supabase/realtime:v2.51.11" // +optional Image string `json:"image,omitempty"` @@ -159,7 +159,7 @@ type RealtimeConfig struct { } type PostgRESTConfig struct { - // +kubebuilder:default="postgrest/postgrest:v12.2.12" + // +kubebuilder:default="postgrest/postgrest:v13.0.7" // +optional Image string `json:"image,omitempty"` @@ -177,7 +177,7 @@ type PostgRESTConfig struct { } type StorageAPIConfig struct { - // +kubebuilder:default="supabase/storage-api:v1.25.7" + // +kubebuilder:default="supabase/storage-api:v1.32.0" // +optional Image string `json:"image,omitempty"` @@ -195,7 +195,7 @@ type StorageAPIConfig struct { } type MetaConfig struct { - // +kubebuilder:default="supabase/postgres-meta:v0.91.0" + // +kubebuilder:default="supabase/postgres-meta:v0.93.1" // +optional Image string `json:"image,omitempty"` diff --git a/api/v1alpha1/supabaseproject_types_test.go b/api/v1alpha1/supabaseproject_types_test.go index e27e0f8..5420780 100644 --- a/api/v1alpha1/supabaseproject_types_test.go +++ b/api/v1alpha1/supabaseproject_types_test.go @@ -166,7 +166,7 @@ func TestStorageConfig_SecretReference(t *testing.T) { func TestKongConfig_Defaults(t *testing.T) { config := &KongConfig{} - expectedImage := "kong:2.8.1" + expectedImage := DefaultKongImage if config.Image == "" { config.Image = expectedImage } @@ -203,7 +203,7 @@ func TestKongConfig_Defaults(t *testing.T) { func TestAuthConfig_Defaults(t *testing.T) { config := &AuthConfig{} - expectedImage := "supabase/gotrue:v2.177.0" + expectedImage := DefaultAuthImage if config.Image == "" { config.Image = expectedImage } @@ -225,7 +225,7 @@ func TestAuthConfig_Defaults(t *testing.T) { func TestRealtimeConfig_Defaults(t *testing.T) { config := &RealtimeConfig{} - expectedImage := "supabase/realtime:v2.34.47" + expectedImage := DefaultRealtimeImage if config.Image == "" { config.Image = expectedImage } @@ -247,7 +247,7 @@ func TestRealtimeConfig_Defaults(t *testing.T) { func TestPostgRESTConfig_Defaults(t *testing.T) { config := &PostgRESTConfig{} - expectedImage := "postgrest/postgrest:v12.2.12" + expectedImage := DefaultPostgRESTImage if config.Image == "" { config.Image = expectedImage } @@ -269,7 +269,7 @@ func TestPostgRESTConfig_Defaults(t *testing.T) { func TestStorageAPIConfig_Defaults(t *testing.T) { config := &StorageAPIConfig{} - expectedImage := "supabase/storage-api:v1.25.7" + expectedImage := DefaultStorageAPIImage if config.Image == "" { config.Image = expectedImage } @@ -291,7 +291,7 @@ func TestStorageAPIConfig_Defaults(t *testing.T) { func TestMetaConfig_Defaults(t *testing.T) { config := &MetaConfig{} - expectedImage := "supabase/postgres-meta:v0.91.0" + expectedImage := DefaultMetaImage if config.Image == "" { config.Image = expectedImage } @@ -313,7 +313,7 @@ func TestMetaConfig_Defaults(t *testing.T) { func TestStudioConfig_Defaults(t *testing.T) { config := &StudioConfig{} - expectedImage := "supabase/studio:2025.10.01-sha-8460121" + expectedImage := DefaultStudioImage if config.Image == "" { config.Image = expectedImage } diff --git a/api/v1alpha1/wellknown_images.go b/api/v1alpha1/wellknown_images.go new file mode 100644 index 0000000..efea960 --- /dev/null +++ b/api/v1alpha1/wellknown_images.go @@ -0,0 +1,24 @@ +package v1alpha1 + +// Default image versions for Supabase components. +// +// This file is the single source of truth for component image defaults. +// The kubebuilder default markers in supabaseproject_types.go must carry +// the same values so that the generated CRD schema matches the webhook +// defaults. Both files are updated together by hack/sync-upstream-images.sh, +// which reads the upstream compose file: +// https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml +const ( + DefaultKongImage = "kong:2.8.1" + DefaultAuthImage = "supabase/gotrue:v2.180.0" + DefaultPostgRESTImage = "postgrest/postgrest:v13.0.7" + DefaultRealtimeImage = "supabase/realtime:v2.51.11" + DefaultStorageAPIImage = "supabase/storage-api:v1.32.0" + DefaultMetaImage = "supabase/postgres-meta:v0.93.1" + DefaultStudioImage = "supabase/studio:2025.10.01-sha-8460121" +) + +// DefaultPostgresImage is used by the database init job only. The operator +// requires a user provided PostgreSQL, so this image is intentionally not +// synced from upstream. +const DefaultPostgresImage = "postgres:15-alpine" diff --git a/hack/sync-upstream-images.sh b/hack/sync-upstream-images.sh new file mode 100755 index 0000000..9e52a17 --- /dev/null +++ b/hack/sync-upstream-images.sh @@ -0,0 +1,100 @@ +#!/bin/bash +set -euo pipefail + +# Sync default component image versions from the upstream Supabase compose file +# https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml +# +# Updates two files that must stay consistent: +# api/v1alpha1/wellknown_images.go Go constants used by the webhook +# api/v1alpha1/supabaseproject_types.go kubebuilder default markers +# Run "make manifests" afterwards to regenerate the CRD schema. +# +# Usage: ./hack/sync-upstream-images.sh [REF] +# REF defaults to master, a tag or commit of supabase/supabase also works. + +UPSTREAM_REPO="https://raw.githubusercontent.com/supabase/supabase" +REF="${1:-master}" +COMPOSE_URL="${UPSTREAM_REPO}/${REF}/docker/docker-compose.yml" + +CONSTANTS_FILE="api/v1alpha1/wellknown_images.go" +TYPES_FILE="api/v1alpha1/supabaseproject_types.go" + +# Format: "compose_service constant_name struct_name" +# The db service is intentionally not listed, the operator requires a user +# provided PostgreSQL so DefaultPostgresImage is never synced from upstream. +MAPPINGS=( + "kong DefaultKongImage KongConfig" + "auth DefaultAuthImage AuthConfig" + "rest DefaultPostgRESTImage PostgRESTConfig" + "realtime DefaultRealtimeImage RealtimeConfig" + "storage DefaultStorageAPIImage StorageAPIConfig" + "meta DefaultMetaImage MetaConfig" + "studio DefaultStudioImage StudioConfig" +) + +compose_file="$(mktemp)" +trap 'rm -f "$compose_file"' EXIT + +echo "Fetching ${COMPOSE_URL}..." +curl -fsSL "$COMPOSE_URL" -o "$compose_file" + +lookup_image() { + awk -v svc="$1" ' + /^ [a-zA-Z0-9_-]+:$/ { current = substr($1, 1, length($1) - 1) } + current == svc && $1 == "image:" { print $2; exit } + ' "$compose_file" +} + +current_constant() { + awk -v name="$1" '$1 == name { gsub(/"/, "", $3); print $3; exit }' "$CONSTANTS_FILE" +} + +update_constant() { + local name="$1" image="$2" + sed -E -i.bak "s|(${name}[[:space:]]*=[[:space:]]*)\"[^\"]*\"|\1\"${image}\"|" "$CONSTANTS_FILE" + rm -f "${CONSTANTS_FILE}.bak" +} + +update_marker() { + local struct="$1" image="$2" + awk -v st="$struct" -v img="$image" ' + $0 ~ "^type " st " struct" { in_struct = 1 } + in_struct && /^}/ { in_struct = 0 } + in_struct && /\+kubebuilder:default="/ && !done { + sub(/\+kubebuilder:default="[^"]*"/, "+kubebuilder:default=\"" img "\"") + done = 1 + } + { print } + ' "$TYPES_FILE" > "${TYPES_FILE}.tmp" + mv "${TYPES_FILE}.tmp" "$TYPES_FILE" +} + +changed=0 +for entry in "${MAPPINGS[@]}"; do + read -r service constant struct <<< "$entry" + + new_image="$(lookup_image "$service")" + if [ -z "$new_image" ]; then + echo "ERROR: service '${service}' not found in upstream compose file" >&2 + exit 1 + fi + + old_image="$(current_constant "$constant")" + if [ "$old_image" = "$new_image" ]; then + echo " = ${service}: ${old_image} (up to date)" + continue + fi + + echo " * ${service}: ${old_image} to ${new_image}" + update_constant "$constant" "$new_image" + update_marker "$struct" "$new_image" + changed=1 +done + +if [ "$changed" -eq 0 ]; then + echo "All component images are up to date." + exit 0 +fi + +gofmt -w "$CONSTANTS_FILE" "$TYPES_FILE" +echo "Done. Run 'make manifests' to regenerate the CRD schema." diff --git a/helm/supabase-operator/crds/supabase.strrl.dev_supabaseprojects.yaml b/helm/supabase-operator/crds/supabase.strrl.dev_supabaseprojects.yaml index 79bad60..2fbcd7a 100644 --- a/helm/supabase-operator/crds/supabase.strrl.dev_supabaseprojects.yaml +++ b/helm/supabase-operator/crds/supabase.strrl.dev_supabaseprojects.yaml @@ -199,7 +199,7 @@ spec: type: object type: array image: - default: supabase/gotrue:v2.177.0 + default: supabase/gotrue:v2.180.0 type: string oauthSecretRef: description: |- @@ -748,7 +748,7 @@ spec: type: object type: array image: - default: supabase/postgres-meta:v0.91.0 + default: supabase/postgres-meta:v0.93.1 type: string replicas: default: 1 @@ -977,7 +977,7 @@ spec: type: object type: array image: - default: postgrest/postgrest:v12.2.12 + default: postgrest/postgrest:v13.0.7 type: string replicas: default: 1 @@ -1209,7 +1209,7 @@ spec: type: object type: array image: - default: supabase/realtime:v2.34.47 + default: supabase/realtime:v2.51.11 type: string replicas: default: 1 @@ -1470,7 +1470,7 @@ spec: type: object type: array image: - default: supabase/storage-api:v1.25.7 + default: supabase/storage-api:v1.32.0 type: string replicas: default: 1 diff --git a/internal/component/auth.go b/internal/component/auth.go index d9b9911..3ac0c1e 100644 --- a/internal/component/auth.go +++ b/internal/component/auth.go @@ -2,7 +2,6 @@ package component import ( "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -24,7 +23,7 @@ func (b *AuthBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*appsv replicas = project.Spec.Auth.Replicas } - image := webhook.DefaultAuthImage + image := v1alpha1.DefaultAuthImage if project.Spec.Auth != nil && project.Spec.Auth.Image != "" { image = project.Spec.Auth.Image } diff --git a/internal/component/database_init.go b/internal/component/database_init.go index c7fdaa1..6d5abec 100644 --- a/internal/component/database_init.go +++ b/internal/component/database_init.go @@ -19,7 +19,6 @@ package component import ( "github.com/strrl/supabase-operator/api/v1alpha1" "github.com/strrl/supabase-operator/internal/database/migrations" - "github.com/strrl/supabase-operator/internal/webhook" batchv1 "k8s.io/api/batch/v1" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -138,7 +137,7 @@ func BuildDatabaseInitJob(project *v1alpha1.SupabaseProject) *batchv1.Job { Containers: []corev1.Container{ { Name: "init", - Image: webhook.DefaultPostgresImage, + Image: v1alpha1.DefaultPostgresImage, Command: []string{ "bash", "/scripts/run-migrations.sh", diff --git a/internal/component/kong.go b/internal/component/kong.go index 26f5fe5..5ac318c 100644 --- a/internal/component/kong.go +++ b/internal/component/kong.go @@ -5,7 +5,6 @@ import ( "strings" "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -27,7 +26,7 @@ func (b *KongBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*appsv replicas = project.Spec.Kong.Replicas } - image := webhook.DefaultKongImage + image := v1alpha1.DefaultKongImage if project.Spec.Kong != nil && project.Spec.Kong.Image != "" { image = project.Spec.Kong.Image } diff --git a/internal/component/meta.go b/internal/component/meta.go index a0fb54d..0e1c71c 100644 --- a/internal/component/meta.go +++ b/internal/component/meta.go @@ -2,7 +2,6 @@ package component import ( "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -24,7 +23,7 @@ func (b *MetaBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*appsv replicas = project.Spec.Meta.Replicas } - image := webhook.DefaultMetaImage + image := v1alpha1.DefaultMetaImage if project.Spec.Meta != nil && project.Spec.Meta.Image != "" { image = project.Spec.Meta.Image } diff --git a/internal/component/postgrest.go b/internal/component/postgrest.go index 6f3de37..b9cfb69 100644 --- a/internal/component/postgrest.go +++ b/internal/component/postgrest.go @@ -2,7 +2,6 @@ package component import ( "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -24,7 +23,7 @@ func (b *PostgRESTBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (* replicas = project.Spec.PostgREST.Replicas } - image := webhook.DefaultPostgRESTImage + image := v1alpha1.DefaultPostgRESTImage if project.Spec.PostgREST != nil && project.Spec.PostgREST.Image != "" { image = project.Spec.PostgREST.Image } diff --git a/internal/component/realtime.go b/internal/component/realtime.go index b84729f..6846504 100644 --- a/internal/component/realtime.go +++ b/internal/component/realtime.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -26,7 +25,7 @@ func (b *RealtimeBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*a replicas = project.Spec.Realtime.Replicas } - image := webhook.DefaultRealtimeImage + image := v1alpha1.DefaultRealtimeImage if project.Spec.Realtime != nil && project.Spec.Realtime.Image != "" { image = project.Spec.Realtime.Image } diff --git a/internal/component/resources_test.go b/internal/component/resources_test.go index 1004cdb..be845d0 100644 --- a/internal/component/resources_test.go +++ b/internal/component/resources_test.go @@ -5,7 +5,6 @@ import ( "testing" "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -40,8 +39,8 @@ func TestBuildKongDeployment(t *testing.T) { t.Errorf("Expected 1 replica, got %d", *deployment.Spec.Replicas) } - if deployment.Spec.Template.Spec.Containers[0].Image != webhook.DefaultKongImage { - t.Errorf("Expected image '%s', got '%s'", webhook.DefaultKongImage, deployment.Spec.Template.Spec.Containers[0].Image) + if deployment.Spec.Template.Spec.Containers[0].Image != v1alpha1.DefaultKongImage { + t.Errorf("Expected image '%s', got '%s'", v1alpha1.DefaultKongImage, deployment.Spec.Template.Spec.Containers[0].Image) } resources := deployment.Spec.Template.Spec.Containers[0].Resources @@ -210,8 +209,8 @@ func TestBuildAuthDeployment(t *testing.T) { t.Errorf("Expected name 'test-project-auth', got '%s'", deployment.Name) } - if deployment.Spec.Template.Spec.Containers[0].Image != webhook.DefaultAuthImage { - t.Errorf("Expected default image '%s', got '%s'", webhook.DefaultAuthImage, deployment.Spec.Template.Spec.Containers[0].Image) + if deployment.Spec.Template.Spec.Containers[0].Image != v1alpha1.DefaultAuthImage { + t.Errorf("Expected default image '%s', got '%s'", v1alpha1.DefaultAuthImage, deployment.Spec.Template.Spec.Containers[0].Image) } } @@ -328,8 +327,8 @@ func TestBuildStudioDeployment(t *testing.T) { } container := deployment.Spec.Template.Spec.Containers[0] - if container.Image != webhook.DefaultStudioImage { - t.Errorf("Expected default image '%s', got '%s'", webhook.DefaultStudioImage, container.Image) + if container.Image != v1alpha1.DefaultStudioImage { + t.Errorf("Expected default image '%s', got '%s'", v1alpha1.DefaultStudioImage, container.Image) } } diff --git a/internal/component/storage.go b/internal/component/storage.go index fc689ee..3285854 100644 --- a/internal/component/storage.go +++ b/internal/component/storage.go @@ -2,7 +2,6 @@ package component import ( "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -24,7 +23,7 @@ func (b *StorageBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*ap replicas = project.Spec.StorageAPI.Replicas } - image := webhook.DefaultStorageAPIImage + image := v1alpha1.DefaultStorageAPIImage if project.Spec.StorageAPI != nil && project.Spec.StorageAPI.Image != "" { image = project.Spec.StorageAPI.Image } diff --git a/internal/component/studio.go b/internal/component/studio.go index 68caf12..200f454 100644 --- a/internal/component/studio.go +++ b/internal/component/studio.go @@ -4,7 +4,6 @@ import ( "fmt" "github.com/strrl/supabase-operator/api/v1alpha1" - "github.com/strrl/supabase-operator/internal/webhook" appsv1 "k8s.io/api/apps/v1" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/api/resource" @@ -26,7 +25,7 @@ func (b *StudioBuilder) BuildDeployment(project *v1alpha1.SupabaseProject) (*app replicas = project.Spec.Studio.Replicas } - image := webhook.DefaultStudioImage + image := v1alpha1.DefaultStudioImage if project.Spec.Studio != nil && project.Spec.Studio.Image != "" { image = project.Spec.Studio.Image } diff --git a/internal/webhook/supabaseproject_webhook.go b/internal/webhook/supabaseproject_webhook.go index 2c60a14..0b5b6d8 100644 --- a/internal/webhook/supabaseproject_webhook.go +++ b/internal/webhook/supabaseproject_webhook.go @@ -48,49 +48,49 @@ func (r *SupabaseProjectWebhook) Default(ctx context.Context, obj runtime.Object project.Spec.Kong = &supabasev1alpha1.KongConfig{} } if project.Spec.Kong.Image == "" { - project.Spec.Kong.Image = DefaultKongImage + project.Spec.Kong.Image = supabasev1alpha1.DefaultKongImage } if project.Spec.Auth == nil { project.Spec.Auth = &supabasev1alpha1.AuthConfig{} } if project.Spec.Auth.Image == "" { - project.Spec.Auth.Image = DefaultAuthImage + project.Spec.Auth.Image = supabasev1alpha1.DefaultAuthImage } if project.Spec.PostgREST == nil { project.Spec.PostgREST = &supabasev1alpha1.PostgRESTConfig{} } if project.Spec.PostgREST.Image == "" { - project.Spec.PostgREST.Image = DefaultPostgRESTImage + project.Spec.PostgREST.Image = supabasev1alpha1.DefaultPostgRESTImage } if project.Spec.Realtime == nil { project.Spec.Realtime = &supabasev1alpha1.RealtimeConfig{} } if project.Spec.Realtime.Image == "" { - project.Spec.Realtime.Image = DefaultRealtimeImage + project.Spec.Realtime.Image = supabasev1alpha1.DefaultRealtimeImage } if project.Spec.StorageAPI == nil { project.Spec.StorageAPI = &supabasev1alpha1.StorageAPIConfig{} } if project.Spec.StorageAPI.Image == "" { - project.Spec.StorageAPI.Image = DefaultStorageAPIImage + project.Spec.StorageAPI.Image = supabasev1alpha1.DefaultStorageAPIImage } if project.Spec.Meta == nil { project.Spec.Meta = &supabasev1alpha1.MetaConfig{} } if project.Spec.Meta.Image == "" { - project.Spec.Meta.Image = DefaultMetaImage + project.Spec.Meta.Image = supabasev1alpha1.DefaultMetaImage } if project.Spec.Studio == nil { project.Spec.Studio = &supabasev1alpha1.StudioConfig{} } if project.Spec.Studio.Image == "" { - project.Spec.Studio.Image = DefaultStudioImage + project.Spec.Studio.Image = supabasev1alpha1.DefaultStudioImage } return nil diff --git a/internal/webhook/wellknown_supabase_images.go b/internal/webhook/wellknown_supabase_images.go deleted file mode 100644 index 1cd0f5d..0000000 --- a/internal/webhook/wellknown_supabase_images.go +++ /dev/null @@ -1,14 +0,0 @@ -package webhook - -// Default image versions for Supabase components -// Upstream reference: https://github.com/supabase/supabase/blob/master/docker/docker-compose.yml -const ( - DefaultKongImage = "kong:2.8.1" - DefaultAuthImage = "supabase/gotrue:v2.180.0" - DefaultPostgRESTImage = "postgrest/postgrest:v13.0.7" - DefaultRealtimeImage = "supabase/realtime:v2.51.11" - DefaultStorageAPIImage = "supabase/storage-api:v1.32.0" - DefaultMetaImage = "supabase/postgres-meta:v0.93.1" - DefaultStudioImage = "supabase/studio:2025.10.01-sha-8460121" - DefaultPostgresImage = "postgres:15-alpine" -)