Skip to content

Commit a5f1128

Browse files
authored
release/goreleaser.opm.Dockerfile: parameterize grpc-health-probe version (#1801)
Signed-off-by: Joe Lanford <[email protected]>
1 parent 017ab53 commit a5f1128

File tree

4 files changed

+15
-5
lines changed

4 files changed

+15
-5
lines changed

.github/workflows/goreleaser.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ jobs:
6161
run: make release
6262
env:
6363
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
RELEASE_ARGS: release --skip=validate --clean -f release/goreleaser.windows.yaml ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
64+
RELEASE_ARGS: release --verbose --skip=validate --clean -f release/goreleaser.windows.yaml ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
6565

6666
- run: tar -cvf dist-windows.tar dist
6767
- uses: actions/upload-artifact@v4
@@ -85,7 +85,7 @@ jobs:
8585
run: make release
8686
env:
8787
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
88-
RELEASE_ARGS: release --rm-dist -f release/goreleaser.darwin.yaml --skip=validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
88+
RELEASE_ARGS: release --verbose --clean -f release/goreleaser.darwin.yaml --skip=validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
8989

9090
- run: gtar -cvf dist-darwin.tar dist
9191
- uses: actions/upload-artifact@v4
@@ -140,7 +140,7 @@ jobs:
140140
run: make release
141141
env:
142142
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
143-
RELEASE_ARGS: release --rm-dist -f release/goreleaser.linux.yaml --skip=validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
143+
RELEASE_ARGS: release --verbose --clean -f release/goreleaser.linux.yaml --skip=validate ${{ github.event_name == 'pull_request' && '--snapshot' || '' }}
144144

145145
- run: tar -cvf dist-linux.tar dist
146146
- uses: actions/upload-artifact@v4

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export PKG := github.com/operator-framework/operator-registry
99
export GIT_COMMIT := $(or $(SOURCE_GIT_COMMIT),$(shell git rev-parse --short HEAD))
1010
export OPM_VERSION := $(or $(SOURCE_GIT_TAG),$(shell git describe --always --tags HEAD))
1111
export BUILD_DATE := $(shell date -u +'%Y-%m-%dT%H:%M:%SZ')
12+
export GRPC_HEALTH_PROBE_VERSION := $(shell $(GO) list -m github.com/grpc-ecosystem/grpc-health-probe | awk '{print $$2}')
1213

1314
.DEFAULT_GOAL := all
1415

@@ -143,7 +144,7 @@ export LATEST_IMAGE_OR_EMPTY := $(shell \
143144
&& [ "$(shell echo -e "$(OPM_VERSION)\n$(LATEST_TAG)" | sort -rV | head -n1)" == "$(OPM_VERSION)" ] \
144145
&& echo "$(OPM_IMAGE_REPO):latest" || echo "")
145146
RELEASE_GOOS := $(shell go env GOOS)
146-
RELEASE_ARGS ?= release --clean --snapshot -f release/goreleaser.$(RELEASE_GOOS).yaml
147+
RELEASE_ARGS ?= release --verbose --clean --snapshot -f release/goreleaser.$(RELEASE_GOOS).yaml
147148

148149
# Note: bingo does not yet support windows (https://github.com/bwplotka/bingo/issues/26)
149150
# so GOOS=windows gets its own way to install goreleaser

release/goreleaser.linux.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ dockers:
8787
use: buildx
8888
build_flag_templates:
8989
- --platform=linux/amd64
90+
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
9091
- image_templates:
9192
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-arm64"
9293
ids: ["linux-arm64"]
@@ -97,6 +98,7 @@ dockers:
9798
use: buildx
9899
build_flag_templates:
99100
- --platform=linux/arm64
101+
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
100102
- image_templates:
101103
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-ppc64le"
102104
ids: ["linux-ppc64le"]
@@ -107,6 +109,7 @@ dockers:
107109
use: buildx
108110
build_flag_templates:
109111
- --platform=linux/ppc64le
112+
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
110113
- image_templates:
111114
- "{{ .Env.OPM_IMAGE_REPO }}:{{ .Env.IMAGE_TAG }}-s390x"
112115
ids: ["linux-s390x"]
@@ -117,6 +120,7 @@ dockers:
117120
use: buildx
118121
build_flag_templates:
119122
- --platform=linux/s390x
123+
- --build-arg=GRPC_HEALTH_PROBE_VERSION={{ .Env.GRPC_HEALTH_PROBE_VERSION }}
120124
docker_manifests:
121125
# IMAGE_TAG is either set by the Makefile or the goreleaser action workflow,
122126
# This image is intended to be tagged/pushed on all trunk (master, release branch) commits and tags.

release/goreleaser.opm.Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
11
# NOTE: This Dockerfile is used in conjuction with GoReleaser to
22
# build opm images. See the configurations in .goreleaser.yaml
33
# and .github/workflows/release.yaml.
4+
#
5+
# The GRPC_HEALTH_PROBE_VERSION is automatically passed as a build arg
6+
# by GoReleaser from the GRPC_HEALTH_PROBE_VERSION environment variable,
7+
# which is set in the Makefile from go.mod.
48

5-
FROM ghcr.io/grpc-ecosystem/grpc-health-probe:v0.4.37 AS grpc_health_probe
9+
ARG GRPC_HEALTH_PROBE_VERSION
10+
FROM ghcr.io/grpc-ecosystem/grpc-health-probe:${GRPC_HEALTH_PROBE_VERSION} AS grpc_health_probe
611
FROM gcr.io/distroless/static:debug
712
COPY --from=grpc_health_probe /ko-app/grpc-health-probe /bin/grpc_health_probe
813
COPY ["nsswitch.conf", "/etc/nsswitch.conf"]

0 commit comments

Comments
 (0)