From 514bf53057da609a2b5f5d08dc267953e5bee77b Mon Sep 17 00:00:00 2001 From: Andrii Dema Date: Mon, 29 Jun 2026 11:21:28 +0300 Subject: [PATCH 1/3] K8SPG-589: delete unused `Makefile` targets https://perconadev.atlassian.net/browse/K8SPG-589 --- Makefile | 98 +------------------------------------------------------- 1 file changed, 1 insertion(+), 97 deletions(-) diff --git a/Makefile b/Makefile index 9311b207fd..3cdb13e1f8 100644 --- a/Makefile +++ b/Makefile @@ -1,17 +1,7 @@ -PGO_IMAGE_NAME ?= percona-postgresql-operator -PGO_IMAGE_MAINTAINER ?= Percona -PGO_IMAGE_SUMMARY ?= Percona PostgreSQL Operator -PGO_IMAGE_DESCRIPTION ?= $(PGO_IMAGE_SUMMARY) -PGO_IMAGE_URL ?= https://github.com/percona/percona-postgresql-operator -PGO_IMAGE_PREFIX ?= localhost - PGMONITOR_DIR ?= hack/tools/pgmonitor PGMONITOR_VERSION ?= v4.11.0 QUERIES_CONFIG_DIR ?= hack/tools/queries -# Buildah's "build" used to be "bud". Use the alias to be compatible for a while. -BUILDAH_BUILD ?= buildah bud - GO ?= CGO_ENABLED=1 go GO_BUILD = $(GO) build -trimpath GO_TEST ?= $(GO) test @@ -44,10 +34,6 @@ help: ## Display this help. all: ## Build all images all: build-docker-image -.PHONY: setup -setup: ## Run Setup needed to build images -setup: get-pgmonitor - .PHONY: get-pgmonitor get-pgmonitor: git -C '$(dir $(PGMONITOR_DIR))' clone https://github.com/CrunchyData/pgmonitor.git || git -C '$(PGMONITOR_DIR)' fetch origin @@ -59,7 +45,6 @@ get-pgmonitor: .PHONY: clean clean: ## Clean resources -clean: clean-deprecated rm -f bin/postgres-operator rm -f config/rbac/role.yaml rm -rf licenses/*/ @@ -71,25 +56,6 @@ clean: clean-deprecated [ ! -n "$$(ls hack/tools)" ] || rm -r hack/tools/* [ ! -d hack/.kube ] || rm -r hack/.kube -.PHONY: clean-deprecated -clean-deprecated: ## Clean deprecated resources - @# packages used to be downloaded into the vendor directory - [ ! -d vendor ] || rm -r vendor - @# executables used to be compiled into the $GOBIN directory - [ ! -n '$(GOBIN)' ] || rm -f $(GOBIN)/postgres-operator $(GOBIN)/apiserver $(GOBIN)/*pgo - @# executables used to be in subdirectories - [ ! -d bin/pgo-rmdata ] || rm -r bin/pgo-rmdata - [ ! -d bin/pgo-backrest ] || rm -r bin/pgo-backrest - [ ! -d bin/pgo-scheduler ] || rm -r bin/pgo-scheduler - [ ! -d bin/postgres-operator ] || rm -r bin/postgres-operator - @# keys used to be generated before install - [ ! -d conf/pgo-backrest-repo ] || rm -r conf/pgo-backrest-repo - [ ! -d conf/postgres-operator ] || rm -r conf/postgres-operator - @# crunchy-postgres-exporter used to live in this repo - [ ! -d bin/crunchy-postgres-exporter ] || rm -r bin/crunchy-postgres-exporter - [ ! -d build/crunchy-postgres-exporter ] || rm -r build/crunchy-postgres-exporter - - ##@ Deployment .PHONY: createnamespaces createnamespaces: ## Create operator and target namespaces @@ -152,44 +118,6 @@ build-postgres-operator: ## Build the postgres-operator binary ) --ldflags '-X "main.versionString=$(PGO_VERSION)"' $(\ ) --trimpath -o bin/postgres-operator ./cmd/postgres-operator -##@ Build - Images -.PHONY: build-postgres-operator-image -build-postgres-operator-image: ## Build the postgres-operator image -build-postgres-operator-image: PGO_IMAGE_REVISION := $(shell git rev-parse HEAD) -build-postgres-operator-image: PGO_IMAGE_TIMESTAMP := $(shell date -u +%FT%TZ) -build-postgres-operator-image: build-postgres-operator -build-postgres-operator-image: build/postgres-operator/Dockerfile - $(if $(shell (echo 'buildah version 1.24'; $(word 1,$(BUILDAH_BUILD)) --version) | sort -Vc 2>&1), \ - $(warning WARNING: old buildah does not invalidate its cache for changed labels: \ - https://github.com/containers/buildah/issues/3517)) - $(if $(IMAGE_TAG),, $(error missing IMAGE_TAG)) - $(strip $(BUILDAH_BUILD)) \ - --tag $(BUILDAH_TRANSPORT)$(PGO_IMAGE_PREFIX)/$(PGO_IMAGE_NAME):$(IMAGE_TAG) \ - --label name='$(PGO_IMAGE_NAME)' \ - --label build-date='$(PGO_IMAGE_TIMESTAMP)' \ - --label description='$(PGO_IMAGE_DESCRIPTION)' \ - --label maintainer='$(PGO_IMAGE_MAINTAINER)' \ - --label summary='$(PGO_IMAGE_SUMMARY)' \ - --label url='$(PGO_IMAGE_URL)' \ - --label vcs-ref='$(PGO_IMAGE_REVISION)' \ - --label vendor='$(PGO_IMAGE_MAINTAINER)' \ - --label io.k8s.display-name='$(PGO_IMAGE_NAME)' \ - --label io.k8s.description='$(PGO_IMAGE_DESCRIPTION)' \ - --label io.openshift.tags="postgresql,postgres,sql,nosql,crunchy" \ - --annotation org.opencontainers.image.authors='$(PGO_IMAGE_MAINTAINER)' \ - --annotation org.opencontainers.image.vendor='$(PGO_IMAGE_MAINTAINER)' \ - --annotation org.opencontainers.image.created='$(PGO_IMAGE_TIMESTAMP)' \ - --annotation org.opencontainers.image.description='$(PGO_IMAGE_DESCRIPTION)' \ - --annotation org.opencontainers.image.revision='$(PGO_IMAGE_REVISION)' \ - --annotation org.opencontainers.image.title='$(PGO_IMAGE_SUMMARY)' \ - --annotation org.opencontainers.image.url='$(PGO_IMAGE_URL)' \ - $(if $(PGO_VERSION),$(strip \ - --label release='$(PGO_VERSION)' \ - --label version='$(PGO_VERSION)' \ - --annotation org.opencontainers.image.version='$(PGO_VERSION)' \ - )) \ - --file $< --format docker --layers . - ##@ Test .PHONY: check check: ## Run basic go tests with coverage output @@ -223,15 +151,6 @@ check-envtest-existing: createnamespaces ##@ Generate -.PHONY: check-generate -check-generate: ## Check crd, deepcopy functions, and rbac generation -check-generate: generate-crd -check-generate: generate-deepcopy -check-generate: generate-rbac - git diff --exit-code -- config/crd - git diff --exit-code -- config/rbac - git diff --exit-code -- pkg/apis - .PHONY: generate generate: ## Generate crd, crd-docs, deepcopy functions, and rbac generate: kustomize @@ -327,18 +246,6 @@ license: licenses licenses: ## Aggregate license files ./bin/license_aggregator.sh ./cmd/... -.PHONY: release-postgres-operator-image release-postgres-operator-image-labels -release-postgres-operator-image: ## Build the postgres-operator image and all its prerequisites -release-postgres-operator-image: release-postgres-operator-image-labels -release-postgres-operator-image: licenses -release-postgres-operator-image: build-postgres-operator-image -release-postgres-operator-image-labels: - $(if $(PGO_IMAGE_DESCRIPTION),, $(error missing PGO_IMAGE_DESCRIPTION)) - $(if $(PGO_IMAGE_MAINTAINER),, $(error missing PGO_IMAGE_MAINTAINER)) - $(if $(PGO_IMAGE_NAME),, $(error missing PGO_IMAGE_NAME)) - $(if $(PGO_IMAGE_SUMMARY),, $(error missing PGO_IMAGE_SUMMARY)) - $(if $(PGO_VERSION),, $(error missing PGO_VERSION)) - ##@ Percona # Default values if not already set @@ -385,9 +292,6 @@ tools/setup-envtest: build-docker-image: get-pgmonitor ROOT_REPO=$(ROOT_REPO) VERSION=$(VERSION) IMAGE=$(IMAGE) $(ROOT_REPO)/e2e-tests/build -build-extension-installer-image: - ROOT_REPO=$(ROOT_REPO) VERSION=$(VERSION) IMAGE=$(IMAGE)-ext-installer COMPONENT=extension-installer $(ROOT_REPO)/e2e-tests/build - SWAGGER = $(shell pwd)/bin/swagger swagger: ## Download swagger locally if necessary. $(call go-get-tool,$(SWAGGER),github.com/go-swagger/go-swagger/cmd/swagger@latest) @@ -423,7 +327,7 @@ update-version: PG_VER ?= $(shell grep -o "postgresVersion: .*" deploy/cr.yaml|grep -oE "[0-9]+") CERT_MANAGER_VER := $(shell grep -Eo "cert-manager v.*" go.mod|grep -Eo "[0-9]+\.[0-9]+\.[0-9]+") include e2e-tests/release_versions -release: generate +release: generate license $(SED) -i "/CERT_MANAGER_VER/s/CERT_MANAGER_VER=\".*/CERT_MANAGER_VER=\"$(CERT_MANAGER_VER)\"/" e2e-tests/functions $(SED) -i \ -e "/^spec:/,/^ crVersion:/{s/crVersion: .*/crVersion: $(VERSION)/}" \ From f126fc427de09c74a4da62a7384b66e92c6c41a0 Mon Sep 17 00:00:00 2001 From: Andrii Dema Date: Thu, 2 Jul 2026 13:05:19 +0300 Subject: [PATCH 2/3] `build-docker-image` => `build` --- CONTRIBUTING.md | 2 +- Jenkinsfile | 2 +- Makefile | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5ea6b09f71..7510cb0bca 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -68,7 +68,7 @@ To build a new Operator image based on your local changes, do the following: 2. Build the Docker image and push it to the specified repository: ``` - $ make build-docker-image + $ make build ``` #### Update deployment manifests diff --git a/Jenkinsfile b/Jenkinsfile index 5b5bd38c32..00e15d0019 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -481,7 +481,7 @@ pipeline { export RELEASE=0 export IMAGE=\$DOCKER_TAG docker buildx create --use - make build-docker-image + make build docker logout " sudo rm -rf build diff --git a/Makefile b/Makefile index 3cdb13e1f8..4be9b2284a 100644 --- a/Makefile +++ b/Makefile @@ -32,7 +32,7 @@ help: ## Display this help. .PHONY: all all: ## Build all images -all: build-docker-image +all: build .PHONY: get-pgmonitor get-pgmonitor: @@ -289,7 +289,7 @@ tools: tools/setup-envtest tools/setup-envtest: $(call go-get-tool,$(ENVTEST),sigs.k8s.io/controller-runtime/tools/setup-envtest@latest) -build-docker-image: get-pgmonitor +build: get-pgmonitor ROOT_REPO=$(ROOT_REPO) VERSION=$(VERSION) IMAGE=$(IMAGE) $(ROOT_REPO)/e2e-tests/build SWAGGER = $(shell pwd)/bin/swagger From c3cc6aba3007118257ffc3c6dd46c2d137c001a9 Mon Sep 17 00:00:00 2001 From: Andrii Dema Date: Mon, 13 Jul 2026 13:51:42 +0300 Subject: [PATCH 3/3] fix `scan.yml` --- .github/workflows/scan.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/scan.yml b/.github/workflows/scan.yml index e232f17a64..6a190d577f 100644 --- a/.github/workflows/scan.yml +++ b/.github/workflows/scan.yml @@ -28,7 +28,7 @@ jobs: export DOCKER_PUSH=0 export DOCKER_SQUASH=0 export DOCKER_DEFAULT_PLATFORM='linux/arm64' - make build-docker-image + make build - name: Build an image from Dockerfile (linux/amd64) run: | @@ -36,4 +36,4 @@ jobs: export DOCKER_PUSH=0 export DOCKER_SQUASH=0 export DOCKER_DEFAULT_PLATFORM='linux/amd64' - make build-docker-image + make build