Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
[submodule "promu"]
path = promu
url = https://github.com/prometheus/promu.git
branch = master
4 changes: 2 additions & 2 deletions .promu.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
go:
# This must match .circle/config.yml.
version: 1.21
version: 1.23
repository:
path: github.com/prometheus-community/postgres_exporter
build:
static: false
binaries:
- name: postgres_exporter
path: ./cmd/postgres_exporter
flags: -a -tags strictfipsruntime
flags: -a -tags strictfipsruntime -mod=readonly
ldflags: |
-X github.com/prometheus/common/version.Version={{.Version}}
-X github.com/prometheus/common/version.Revision={{.Revision}}
Expand Down
6 changes: 6 additions & 0 deletions .tekton/postgres-exporter-globalhub-1-5-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ spec:
value: Containerfile.konflux
- name: path-context
value: .
- name: build-source-image
value: "true"
- name: hermetic
value: "true"
- name: prefetch-input
value: '[ {"type": "gomod", "path": "."}, {"type": "gomod", "path": "./promu"} ]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
6 changes: 6 additions & 0 deletions .tekton/postgres-exporter-globalhub-1-5-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ spec:
value: Containerfile.konflux
- name: path-context
value: .
- name: build-source-image
value: "true"
- name: hermetic
value: "true"
- name: prefetch-input
value: '[ {"type": "gomod", "path": "."}, {"type": "gomod", "path": "./promu"} ]'
pipelineSpec:
description: |
This pipeline is ideal for building multi-arch container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down
51 changes: 19 additions & 32 deletions Containerfile.konflux
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,30 @@ FROM brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.23 AS bui
WORKDIR /workspace
COPY . .

RUN git clone https://github.com/prometheus/promu.git && cd promu && go mod vendor && go build -o /usr/local/bin .
RUN cd promu && CGO_ENABLED=1 GOFLAGS="-p=4" go build -mod=readonly -a -v -o /usr/local/bin .
ENV BUILD_PROMU=false
RUN go mod vendor && promu build --cgo --prefix ./
RUN promu build --cgo --prefix ./

# Stage 2: Copy the binaries from the image builder to the base image
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest

ARG VCS_REF
ARG VCS_URL
ARG IMAGE_NAME
ARG IMAGE_DESCRIPTION
ARG IMAGE_DISPLAY_NAME
ARG IMAGE_NAME_ARCH
ARG IMAGE_MAINTAINER
ARG IMAGE_VENDOR
ARG IMAGE_VERSION
ARG IMAGE_RELEASE
ARG IMAGE_SUMMARY
ARG IMAGE_OPENSHIFT_TAGS

LABEL org.label-schema.vendor="Red Hat" \
org.label-schema.name="$IMAGE_NAME_ARCH" \
org.label-schema.description="$IMAGE_DESCRIPTION" \
org.label-schema.vcs-ref=$VCS_REF \
org.label-schema.vcs-url=$VCS_URL \
org.label-schema.license="Red Hat Advanced Cluster Management for Kubernetes EULA" \
org.label-schema.schema-version="1.0" \
name="$IMAGE_NAME" \
maintainer="$IMAGE_MAINTAINER" \
vendor="$IMAGE_VENDOR" \
version="$IMAGE_VERSION" \
release="$IMAGE_RELEASE" \
description="$IMAGE_DESCRIPTION" \
summary="$IMAGE_SUMMARY" \
io.k8s.display-name="$IMAGE_DISPLAY_NAME" \
io.k8s.description="$IMAGE_DESCRIPTION" \
io.openshift.tags="$IMAGE_OPENSHIFT_TAGS"
# Red Hat annotations.
LABEL com.redhat.component="multicluster global hub postgres exporter"
LABEL org.label-schema.vendor="Red Hat"
LABEL org.label-schema.license="Red Hat Advanced Cluster Management for Kubernetes EULA"
LABEL org.label-schema.schema-version="1.0"

# Bundle metadata
LABEL name="multicluster-global-hub/postgres_exporter"
LABEL version="release-1.5"
LABEL summary="multicluster global hub postgres exporter"
LABEL io.openshift.expose-services=""
LABEL io.openshift.tags="data,images"
LABEL io.k8s.display-name="multicluster global hub postgres exporter"
LABEL io.k8s.description="This is the standard release image for the multicluster global hub postgres exporter"
LABEL maintainer="['acm-component-maintainers@redhat.com']"
LABEL description="multicluster global hub postgres exporter"


COPY --from=builder /workspace/postgres_exporter /bin/postgres_exporter

Expand Down
1 change: 1 addition & 0 deletions promu
Submodule promu added at d76561