diff --git a/Makefile b/Makefile index 4f5441cf1..02c9c73f5 100644 --- a/Makefile +++ b/Makefile @@ -13,7 +13,7 @@ LDFLAGS ?= -X=main.version=$(VERSION) DOCKERDIR = docker BASE_IMAGE ?= alpine:latest -IMAGE ?= $(BINARY) +IMAGE ?= ghcr.io/zalando/$(BINARY) TAG ?= $(VERSION) GITHEAD = $(shell git rev-parse --short HEAD) GITURL = $(shell git config --get remote.origin.url) @@ -84,7 +84,7 @@ linux: ${SOURCES} $(GENERATED_CRDS) macos: ${SOURCES} $(GENERATED_CRDS) GOOS=darwin GOARCH=amd64 CGO_ENABLED=${CGO_ENABLED} go build -o build/macos/${BINARY} ${BUILD_FLAGS} -ldflags "$(LDFLAGS)" $(SOURCES) -docker: ${DOCKERDIR}/${DOCKERFILE} +docker: $(GENERATED_CRDS) ${DOCKERDIR}/${DOCKERFILE} echo `(env)` echo "Tag ${TAG}" echo "Version ${VERSION}" diff --git a/e2e/run.sh b/e2e/run.sh index 2cd2b450b..c69c70bd7 100755 --- a/e2e/run.sh +++ b/e2e/run.sh @@ -19,14 +19,16 @@ echo "Kubeconfig path: ${kubeconfig_path}" function pull_images(){ operator_tag=$(git describe --tags --always --dirty) - target_image=docker.io/library/postgres-operator:${operator_tag} - if [[ -z $(docker images -q "postgres-operator:${operator_tag}") ]] + image_name="ghcr.io/zalando/postgres-operator:${operator_tag}" + if [[ -z $(docker images -q "${image_name}") ]] then - echo "Local image not found. Pulling operator image from ghcr.io and tagging it as ${target_image}" - docker pull ghcr.io/zalando/postgres-operator:latest - docker tag ghcr.io/zalando/postgres-operator:latest "${target_image}" + if ! docker pull "${image_name}" + then + echo "Failed to pull operator image: ${image_name}" + exit 1 + fi fi - operator_image=${target_image} + operator_image="${image_name}" echo "Using operator image: ${operator_image}" }