Skip to content

Commit f10e20c

Browse files
authored
Merge pull request #3 from stolostron/konflux_enablement
Onboard postgres_exporter to Konflux
2 parents ffbf677 + cc92752 commit f10e20c

6 files changed

+54
-35
lines changed

.github/workflows/golangci-lint.yml

-32
This file was deleted.

.tekton/postgres-exporter-globalhub-1-3-pull-request.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ spec:
2727
- name: image-expires-after
2828
value: 5d
2929
- name: dockerfile
30-
value: Dockerfile
30+
value: Containerfile.operator
3131
- name: path-context
3232
value: .
3333
pipelineSpec:

.tekton/postgres-exporter-globalhub-1-3-push.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ spec:
2424
- name: output-image
2525
value: quay.io/redhat-user-workloads/acm-multicluster-glo-tenant/release-globalhub-1-3/postgres-exporter-globalhub-1-3:{{revision}}
2626
- name: dockerfile
27-
value: Dockerfile
27+
value: Containerfile.operator
2828
- name: path-context
2929
value: .
3030
pipelineSpec:

Containerfile.operator

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.22 AS builder
2+
3+
WORKDIR /workspace
4+
COPY . .
5+
6+
RUN git clone https://github.com/prometheus/promu.git && cd promu && go mod vendor && go build -o /usr/local/bin .
7+
ENV BUILD_PROMU=false
8+
RUN go mod vendor && promu build --cgo --prefix ./
9+
10+
# Stage 2: Copy the binaries from the image builder to the base image
11+
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
12+
13+
ARG VCS_REF
14+
ARG VCS_URL
15+
ARG IMAGE_NAME
16+
ARG IMAGE_DESCRIPTION
17+
ARG IMAGE_DISPLAY_NAME
18+
ARG IMAGE_NAME_ARCH
19+
ARG IMAGE_MAINTAINER
20+
ARG IMAGE_VENDOR
21+
ARG IMAGE_VERSION
22+
ARG IMAGE_RELEASE
23+
ARG IMAGE_SUMMARY
24+
ARG IMAGE_OPENSHIFT_TAGS
25+
26+
LABEL org.label-schema.vendor="Red Hat" \
27+
org.label-schema.name="$IMAGE_NAME_ARCH" \
28+
org.label-schema.description="$IMAGE_DESCRIPTION" \
29+
org.label-schema.vcs-ref=$VCS_REF \
30+
org.label-schema.vcs-url=$VCS_URL \
31+
org.label-schema.license="Red Hat Advanced Cluster Management for Kubernetes EULA" \
32+
org.label-schema.schema-version="1.0" \
33+
name="$IMAGE_NAME" \
34+
maintainer="$IMAGE_MAINTAINER" \
35+
vendor="$IMAGE_VENDOR" \
36+
version="$IMAGE_VERSION" \
37+
release="$IMAGE_RELEASE" \
38+
description="$IMAGE_DESCRIPTION" \
39+
summary="$IMAGE_SUMMARY" \
40+
io.k8s.display-name="$IMAGE_DISPLAY_NAME" \
41+
io.k8s.description="$IMAGE_DESCRIPTION" \
42+
io.openshift.tags="$IMAGE_OPENSHIFT_TAGS"
43+
44+
COPY --from=builder /workspace/postgres_exporter /bin/postgres_exporter
45+
46+
EXPOSE 9187
47+
USER nobody
48+
ENTRYPOINT [ "/bin/postgres_exporter" ]

go.mod

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/prometheus-community/postgres_exporter
22

3-
go 1.19
3+
go 1.22.4
44

55
require (
66
github.com/DATA-DOG/go-sqlmock v1.5.0

go.sum

+3
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV
1515
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
1616
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1717
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
18+
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
1819
github.com/go-kit/log v0.2.1 h1:MRVx0/zhvdseW+Gza6N9rVzU/IVzaeE1SFI4raAhmBU=
1920
github.com/go-kit/log v0.2.1/go.mod h1:NwTd00d/i8cPZ3xOwwiv2PO5MOcx78fFErGNcVmBjv0=
2021
github.com/go-logfmt/logfmt v0.5.1 h1:otpy5pqBCBZ1ng9RQ0dPu4PN7ba75Y/aA+UpowDyNVA=
@@ -27,6 +28,7 @@ github.com/golang/protobuf v1.5.3 h1:KhyjKVUg7Usr/dYsdSqoFveMYd5ko72D+zANwlG1mmg
2728
github.com/golang/protobuf v1.5.3/go.mod h1:XVQd3VNwM+JqD3oG2Ue2ip4fOMUkwXdXDdiuN0vRsmY=
2829
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
2930
github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38=
31+
github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
3032
github.com/gopherjs/gopherjs v1.17.2 h1:fQnZVsXk8uxXIStYb0N4bGk7jeyTalG/wsZjQ25dO0g=
3133
github.com/gopherjs/gopherjs v1.17.2/go.mod h1:pRRIvn/QzFLrKfvEz3qUuEhtE/zLCWfreZ6J5gM2i+k=
3234
github.com/jpillora/backoff v1.0.0 h1:uvFg412JmmHBHw7iwprIxkPMI+sGQ4kzOWsMeHnm2EA=
@@ -69,6 +71,7 @@ github.com/smartystreets/goconvey v1.8.1/go.mod h1:+/u4qLyY6x1jReYOp7GOM2FSt8aP9
6971
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
7072
github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
7173
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
74+
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
7275
github.com/xhit/go-str2duration/v2 v2.1.0 h1:lxklc02Drh6ynqX+DdPyp5pCKLUQpRT8bp8Ydu2Bstc=
7376
github.com/xhit/go-str2duration/v2 v2.1.0/go.mod h1:ohY8p+0f07DiV6Em5LKB0s2YpLtXVyJfNt1+BlmyAsU=
7477
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=

0 commit comments

Comments
 (0)