From e5ff5a90c5341e62352aa4b378ceb27745154c7d Mon Sep 17 00:00:00 2001 From: Falkan Date: Thu, 19 Mar 2026 01:08:02 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20build-push.sh=20=E2=80=94=20push=20via?= =?UTF-8?q?=20port-forward,=20tag=20with=20in-cluster=20registry=20address?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- build-push.sh | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/build-push.sh b/build-push.sh index 7d54504..c85c2cf 100755 --- a/build-push.sh +++ b/build-push.sh @@ -5,10 +5,11 @@ set -euo pipefail TAG="${1:-latest}" -REGISTRY="localhost:5000" # via kubectl port-forward +# In-cluster address — how the deployment manifest references the image +REGISTRY="registry.registry.svc.cluster.local:5000" IMAGE="$REGISTRY/humor-units:$TAG" -echo "==> Port-forwarding registry..." +echo "==> Port-forwarding registry (localhost:5000 -> in-cluster registry)..." kubectl port-forward -n registry svc/registry 5000:5000 & PF_PID=$! trap "kill $PF_PID 2>/dev/null" EXIT @@ -20,8 +21,13 @@ buildah build \ --tag "$IMAGE" \ "$(dirname "$0")" -echo "==> Pushing $IMAGE..." -buildah push --tls-verify=false "$IMAGE" +echo "==> Pushing via port-forward (localhost:5000)..." +# Push to localhost:5000 (the port-forward tunnel) but with the in-cluster tag. +# buildah push accepts a separate destination so we don't retag. +buildah push \ + --tls-verify=false \ + "$IMAGE" \ + "docker://localhost:5000/humor-units:$TAG" echo "==> Restarting humor-units deployment..." kubectl rollout restart deployment/humor-units -n default