Skip to content

Commit 9e7ae18

Browse files
authored
SREP-1985 : Fix Go vulnerabilities CVES updating to UBI9 Go toolset 1.24.6 (#433)
* Fix Go vulnerabilities CVE-2025-47907/47906 by updating to UBI9 Go toolset 1.24.6 * Fix e2e Dockerfile permissions for UBI9 Go toolset non-root user * Use specific version tag (1.24) instead of latest for UBI9 Go toolset
1 parent ec0e9dd commit 9e7ae18

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

boilerplate/openshift/golang-osd-e2e/update

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ OPERATOR_NAME_CAMEL_CASE=${OPERATOR_PROPER_NAME// /}
2121

2222
mkdir -p "${E2E_SUITE_DIRECTORY}"
2323

24-
E2E_SUITE_BUILDER_IMAGE=registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.24-openshift-4.21
24+
E2E_SUITE_BUILDER_IMAGE=registry.access.redhat.com/ubi9/go-toolset:1.24
2525
if [[ -n ${KONFLUX_BUILDS} ]]; then
2626
E2E_SUITE_BUILDER_IMAGE="brew.registry.redhat.io/rh-osbs/openshift-golang-builder:rhel_9_1.24"
2727
fi
@@ -30,12 +30,12 @@ echo "syncing ${E2E_SUITE_DIRECTORY}/Dockerfile"
3030
tee "${E2E_SUITE_DIRECTORY}/Dockerfile" <<EOF
3131
# THIS FILE IS GENERATED BY BOILERPLATE. DO NOT EDIT.
3232
FROM ${E2E_SUITE_BUILDER_IMAGE} as builder
33-
WORKDIR /go/src/github.com/openshift/$OPERATOR_NAME/
33+
WORKDIR /opt/app-root/src
3434
COPY . .
35-
RUN CGO_ENABLED=0 GOFLAGS="-mod=mod" go test ./test/e2e -v -c --tags=osde2e -o /e2e.test
35+
RUN CGO_ENABLED=0 GOFLAGS="-mod=mod" go test ./test/e2e -v -c --tags=osde2e -o e2e.test
3636
3737
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
38-
COPY --from=builder ./e2e.test e2e.test
38+
COPY --from=builder /opt/app-root/src/e2e.test e2e.test
3939
ENTRYPOINT [ "/e2e.test" ]
4040
EOF
4141

build/Dockerfile

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
1-
ARG BASE_IMAGE=registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.24-openshift-4.21
1+
ARG BASE_IMAGE=registry.access.redhat.com/ubi9/go-toolset:1.24
22
FROM ${BASE_IMAGE} AS builder
33

4-
RUN mkdir -p /workdir
5-
WORKDIR /workdir
4+
WORKDIR /opt/app-root/src
65
COPY go.mod go.sum ./
76
RUN go mod download
87
COPY . .
9-
RUN make build
8+
RUN GOOS=linux GOARCH=amd64 CGO_ENABLED=1 GOEXPERIMENT=boringcrypto GOFLAGS=-mod=mod \
9+
go build -buildvcs=false -gcflags="all=-trimpath=/opt/app-root/src" -asmflags="all=-trimpath=/opt/app-root/src" -tags="fips_enabled" \
10+
-o webhooks ./cmd
1011

1112
####
1213
FROM registry.access.redhat.com/ubi9/ubi-minimal:latest
1314

1415
ENV USER_UID=1001 \
1516
USER_NAME=webhooks
1617

17-
COPY --from=builder /workdir/build/_output/webhooks /usr/local/bin/
18+
COPY --from=builder /opt/app-root/src/webhooks /usr/local/bin/
1819

1920
COPY build/bin /usr/local/bin
2021
RUN /usr/local/bin/user_setup

test/e2e/Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# THIS FILE IS GENERATED BY BOILERPLATE. DO NOT EDIT.
2-
FROM registry.ci.openshift.org/openshift/release:rhel-9-release-golang-1.24-openshift-4.21 as builder
3-
WORKDIR /go/src/github.com/openshift/validation-webhook/
2+
FROM registry.access.redhat.com/ubi9/go-toolset:1.24 as builder
3+
WORKDIR /opt/app-root/src
44
COPY . .
5-
RUN CGO_ENABLED=0 GOFLAGS="-mod=mod" go test ./test/e2e -v -c --tags=osde2e -o /e2e.test
5+
RUN CGO_ENABLED=0 GOFLAGS="-mod=mod" go test ./test/e2e -v -c --tags=osde2e -o e2e.test
66

77
FROM registry.access.redhat.com/ubi8/ubi-minimal:latest
8-
COPY --from=builder ./e2e.test e2e.test
8+
COPY --from=builder /opt/app-root/src/e2e.test e2e.test
99
ENTRYPOINT [ "/e2e.test" ]

0 commit comments

Comments
 (0)