Skip to content

Commit 481d222

Browse files
committed
Remove all crunchy-postgres-exporter stuff. Try fixing github action test failure.
1 parent 0958db4 commit 481d222

File tree

4 files changed

+5
-91
lines changed

4 files changed

+5
-91
lines changed

.github/workflows/test.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ jobs:
3434
- uses: actions/setup-go@v3
3535
with: { go-version: 1.x }
3636
- run: go mod download
37-
- run: ENVTEST_K8S_VERSION="${KUBERNETES#default}" make check-envtest
37+
- run: ENVTEST_K8S_VERSION="${KUBERNETES#default}" QUERIES_CONFIG_DIR="${QUERIES_CONFIG_DIR}" make check-envtest
3838
env:
3939
KUBERNETES: "${{ matrix.kubernetes }}"
4040
GO_TEST: go test --coverprofile 'envtest.coverage' --coverpkg ./internal/...
@@ -69,7 +69,7 @@ jobs:
6969
registry.developers.crunchydata.com/crunchydata/crunchy-pgbouncer:ubi8-1.19-3
7070
registry.developers.crunchydata.com/crunchydata/crunchy-postgres:ubi8-14.8-3
7171
72-
- run: make createnamespaces check-envtest-existing
72+
- run: QUERIES_CONFIG_DIR="${QUERIES_CONFIG_DIR}" make createnamespaces check-envtest-existing
7373
env:
7474
PGO_TEST_TIMEOUT_SCALE: 1.2
7575
GO_TEST: go test --coverprofile 'envtest-existing.coverage' --coverpkg ./internal/...

Makefile

Lines changed: 3 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,8 @@ PGO_IMAGE_DESCRIPTION ?= $(PGO_IMAGE_SUMMARY)
55
PGO_IMAGE_URL ?= https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes
66
PGO_IMAGE_PREFIX ?= localhost
77

8-
CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME ?= crunchy-postgres-exporter
9-
CRUNCHY_POSTGRES_EXPORTER_MAINTAINER ?= $(PGO_IMAGE_MAINTAINER)
10-
CRUNCHY_POSTGRES_EXPORTER_SUMMARY ?= Metrics exporter for PostgreSQL
11-
CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION ?= \
12-
When run with the crunchy-postgres family of containers, crunchy-postgres-exporter reads the PostgreSQL data directory \
13-
and has a SQL interface to a database to allow for metrics collection.
14-
CRUNCHY_POSTGRES_EXPORTER_URL ?= https://www.crunchydata.com/products/crunchy-postgresql-for-kubernetes
15-
CRUNCHY_POSTGRES_EXPORTER_IMAGE_PREFIX ?= $(PGO_IMAGE_PREFIX)
16-
CRUNCHY_POSTGRES_EXPORTER_PG_VERSION ?= 15
17-
CRUNCHY_POSTGRES_EXPORTER_PG_FULL_VERSION ?= 15.3
18-
198
PGMONITOR_DIR ?= hack/tools/pgmonitor
209
PGMONITOR_VERSION ?= v4.8.1
21-
POSTGRES_EXPORTER_VERSION ?= 0.12.1
22-
POSTGRES_EXPORTER_ARCHITECTURE ?= amd64
23-
POSTGRES_EXPORTER_URL ?= https://github.com/prometheus-community/postgres_exporter/releases/download/v${POSTGRES_EXPORTER_VERSION}/postgres_exporter-${POSTGRES_EXPORTER_VERSION}.linux-${POSTGRES_EXPORTER_ARCHITECTURE}.tar.gz
2410
QUERIES_CONFIG_DIR ?= hack/tools/queries
2511

2612
# Buildah's "build" used to be "bud". Use the alias to be compatible for a while.
@@ -59,12 +45,10 @@ help: ## Display this help.
5945
.PHONY: all
6046
all: ## Build all images
6147
all: build-postgres-operator-image
62-
all: build-crunchy-postgres-exporter-image
6348

6449
.PHONY: setup
6550
setup: ## Run Setup needed to build images
6651
setup: get-pgmonitor
67-
setup: get-postgres-exporter
6852

6953
.PHONY: get-pgmonitor
7054
get-pgmonitor:
@@ -75,13 +59,6 @@ get-pgmonitor:
7559
cp -r '$(PGMONITOR_DIR)/postgres_exporter/common/.' '${QUERIES_CONFIG_DIR}'
7660
cp '$(PGMONITOR_DIR)/postgres_exporter/linux/queries_backrest.yml' '${QUERIES_CONFIG_DIR}'
7761

78-
.PHONY: get-postgres-exporter
79-
get-postgres-exporter:
80-
[ ! -e hack/tools/postgres_exporter.tar.gz ] || (rm hack/tools/postgres_exporter.tar.gz && echo "Deleting old exporter tar")
81-
wget -O hack/tools/postgres_exporter.tar.gz '$(POSTGRES_EXPORTER_URL)'
82-
[ ! -e hack/bin/postgres_exporter ] || (rm -r hack/bin/postgres_exporter && echo "Deleting old exporter binary")
83-
tar -xzf hack/tools/postgres_exporter.tar.gz -C hack/tools/ && mv hack/tools/postgres_exporter-${POSTGRES_EXPORTER_VERSION}.linux-${POSTGRES_EXPORTER_ARCHITECTURE} hack/bin/postgres_exporter
84-
8562
.PHONY: clean
8663
clean: ## Clean resources
8764
clean: clean-deprecated
@@ -96,7 +73,6 @@ clean: clean-deprecated
9673
[ ! -d hack/tools/pgmonitor ] || rm -rf hack/tools/pgmonitor
9774
[ ! -n "$$(ls hack/tools)" ] || rm -r hack/tools/*
9875
[ ! -d hack/.kube ] || rm -r hack/.kube
99-
[ ! -d hack/bin/postgres_exporter ] || rm -r hack/bin/postgres_exporter
10076

10177
.PHONY: clean-deprecated
10278
clean-deprecated: ## Clean deprecated resources
@@ -112,8 +88,10 @@ clean-deprecated: ## Clean deprecated resources
11288
@# keys used to be generated before install
11389
[ ! -d conf/pgo-backrest-repo ] || rm -r conf/pgo-backrest-repo
11490
[ ! -d conf/postgres-operator ] || rm -r conf/postgres-operator
115-
@# crunchy-postgres-exporter used to use scripts stored in bin/crunchy-postgres-exporter
91+
@# crunchy-postgres-exporter used to live in this repo
11692
[ ! -d bin/crunchy-postgres-exporter ] || rm -r bin/crunchy-postgres-exporter
93+
[ ! -d build/crunchy-postgres-exporter ] || rm -r build/crunchy-postgres-exporter
94+
11795

11896
##@ Deployment
11997
.PHONY: createnamespaces
@@ -169,44 +147,6 @@ build-postgres-operator: ## Build the postgres-operator binary
169147
-o bin/postgres-operator ./cmd/postgres-operator
170148

171149
##@ Build - Images
172-
.PHONY: build-crunchy-postgres-exporter-image
173-
build-crunchy-postgres-exporter-image: ## Build the crunchy-postgres-exporter image
174-
build-crunchy-postgres-exporter-image: CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION := $(shell git rev-parse HEAD)
175-
build-crunchy-postgres-exporter-image: CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP := $(shell date -u +%FT%TZ)
176-
build-crunchy-postgres-exporter-image: build/crunchy-postgres-exporter/Dockerfile
177-
$(if $(shell (echo 'buildah version 1.24'; $(word 1,$(BUILDAH_BUILD)) --version) | sort -Vc 2>&1), \
178-
$(warning WARNING: old buildah does not invalidate its cache for changed labels: \
179-
https://github.com/containers/buildah/issues/3517))
180-
$(if $(IMAGE_TAG),, $(error missing IMAGE_TAG))
181-
$(strip $(BUILDAH_BUILD)) \
182-
--tag $(BUILDAH_TRANSPORT)$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_PREFIX)/$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME):$(IMAGE_TAG) \
183-
--label name='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME)' \
184-
--label build-date='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP)' \
185-
--label description='$(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
186-
--label maintainer='$(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
187-
--label summary='$(CRUNCHY_POSTGRES_EXPORTER_SUMMARY)' \
188-
--label url='$(CRUNCHY_POSTGRES_EXPORTER_URL)' \
189-
--label vcs-ref='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION)' \
190-
--label vendor='$(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
191-
--label postgres.version.major='$(CRUNCHY_POSTGRES_EXPORTER_PG_VERSION)' \
192-
--label postgres.version='$(CRUNCHY_POSTGRES_EXPORTER_PG_FULL_VERSION)' \
193-
--label io.k8s.display-name='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME)' \
194-
--label io.k8s.description='$(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
195-
--label io.openshift.tags="postgresql,postgres,monitoring,database,crunchy" \
196-
--annotation org.opencontainers.image.authors='$(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
197-
--annotation org.opencontainers.image.vendor='$(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER)' \
198-
--annotation org.opencontainers.image.created='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_TIMESTAMP)' \
199-
--annotation org.opencontainers.image.description='$(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION)' \
200-
--annotation org.opencontainers.image.revision='$(CRUNCHY_POSTGRES_EXPORTER_IMAGE_REVISION)' \
201-
--annotation org.opencontainers.image.title='$(CRUNCHY_POSTGRES_EXPORTER_SUMMARY)' \
202-
--annotation org.opencontainers.image.url='$(CRUNCHY_POSTGRES_EXPORTER_URL)' \
203-
$(if $(PGO_VERSION),$(strip \
204-
--label release='$(PGO_VERSION)' \
205-
--label version='$(PGO_VERSION)' \
206-
--annotation org.opencontainers.image.version='$(PGO_VERSION)' \
207-
)) \
208-
--file $< --format docker --layers .
209-
210150
.PHONY: build-postgres-operator-image
211151
build-postgres-operator-image: ## Build the postgres-operator image
212152
build-postgres-operator-image: PGO_IMAGE_REVISION := $(shell git rev-parse HEAD)
@@ -377,14 +317,3 @@ release-postgres-operator-image-labels:
377317
$(if $(PGO_IMAGE_NAME),, $(error missing PGO_IMAGE_NAME))
378318
$(if $(PGO_IMAGE_SUMMARY),, $(error missing PGO_IMAGE_SUMMARY))
379319
$(if $(PGO_VERSION),, $(error missing PGO_VERSION))
380-
381-
.PHONY: release-crunchy-postgres-exporter-image release-crunchy-postgres-exporter-image-labels
382-
release-crunchy-postgres-exporter-image: ## Build the postgres-operator image and all its prerequisites
383-
release-crunchy-postgres-exporter-image: release-crunchy-postgres-exporter-image-labels
384-
release-crunchy-postgres-exporter-image: build-crunchy-postgres-exporter-image
385-
release-crunchy-postgres-exporter-image-labels:
386-
$(if $(CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION),, $(error missing CRUNCHY_POSTGRES_EXPORTER_DESCRIPTION))
387-
$(if $(CRUNCHY_POSTGRES_EXPORTER_MAINTAINER),, $(error missing CRUNCHY_POSTGRES_EXPORTER_MAINTAINER))
388-
$(if $(CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME),, $(error missing CRUNCHY_POSTGRES_EXPORTER_IMAGE_NAME))
389-
$(if $(CRUNCHY_POSTGRES_EXPORTER_SUMMARY),, $(error missing CRUNCHY_POSTGRES_EXPORTER_SUMMARY))
390-
$(if $(PGO_VERSION),, $(error missing PGO_VERSION))

build/crunchy-postgres-exporter/Dockerfile

Lines changed: 0 additions & 14 deletions
This file was deleted.

hack/bin/.gitignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)