Skip to content

Commit 371776a

Browse files
Update to Go 1.22 (#105)
* bump go.mod to go 1.22 Signed-off-by: Michael Valdron <mvaldron@redhat.com> * use ubi9 base images with go-toolset 1.22.9 builder Signed-off-by: Michael Valdron <mvaldron@redhat.com> * update go version requirement to 1.22 under README Signed-off-by: Michael Valdron <mvaldron@redhat.com> * add Go badge to README Signed-off-by: Michael Valdron <mvaldron@redhat.com> * update gosec to v2.22.0 Signed-off-by: Michael Valdron <mvaldron@redhat.com> * pin base images using list digests Signed-off-by: Michael Valdron <mvaldron@redhat.com> --------- Signed-off-by: Michael Valdron <mvaldron@redhat.com>
1 parent 71ce01c commit 371776a

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080

8181
- name: Run Gosec Security Scanner
8282
run: |
83-
go install github.com/securego/gosec/v2/cmd/gosec@1af1d5bb49259b62e45c505db397dd2ada5d74f8
83+
go install github.com/securego/gosec/v2/cmd/gosec@e0cca6fe95306b7e7790d6f1bf6a7bec6d622459 # v2.22.0
8484
make gosec
8585
if [[ $? != 0 ]]
8686
then

Dockerfile

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,9 @@
1414
# limitations under the License.
1515

1616
# Build the manager binary
17-
FROM golang:1.21@sha256:b405b620c7b53ef64695c7da7c8396f411f381c1eb7da6713c585dd7eca1559b as builder
17+
FROM registry.access.redhat.com/ubi9/go-toolset:1.22.9@sha256:e4193e71ea9f2e2504f6b4ee93cadef0fe5d7b37bba57484f4d4229801a7c063 as builder
1818
ARG TARGETARCH=amd64
19+
USER root
1920

2021
WORKDIR /workspace
2122
# Copy the Go Modules manifests
@@ -41,9 +42,8 @@ ENV ENABLE_WEBHOOKS=${ENABLE_WEBHOOKS}
4142
ARG ENABLE_WEBHOOK_HTTP2=false
4243
ENV ENABLE_WEBHOOK_HTTP2=${ENABLE_WEBHOOK_HTTP2}
4344

44-
# Use distroless as minimal base image to package the manager binary
45-
# Refer to https://github.com/GoogleContainerTools/distroless for more details
46-
FROM gcr.io/distroless/static:nonroot-${TARGETARCH}
45+
# Use ubi-micro as minimal base image to package the manager binary
46+
FROM registry.access.redhat.com/ubi9/ubi-micro:9.6@sha256:955512628a9104d74f7b3b0a91db27a6bbecdd6a1975ce0f1b2658d3cd060b98
4747
WORKDIR /
4848
COPY --from=builder /workspace/manager .
4949
USER 1001

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,5 +340,5 @@ bundle-push:
340340
.PHONY: gosec
341341
gosec:
342342
# Run this command to install gosec, if not installed:
343-
# go install github.com/securego/gosec/v2/cmd/gosec@v2.14.0
343+
# go install github.com/securego/gosec/v2/cmd/gosec@v2.22.0
344344
gosec -no-fail -fmt=sarif -out=gosec.sarif -exclude-dir pkg/test -exclude-dir tests ./...

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
<div id="header">
55

6+
[![Go 1.22](https://img.shields.io/badge/1.22-blue?logo=go&labelColor=gray)](https://go.dev/doc/go1.22)
67
[![Apache2.0 License](https://img.shields.io/badge/license-Apache2.0-brightgreen.svg)](LICENSE)
78
[![OpenSSF Best Practices](https://www.bestpractices.dev/projects/8256/badge)](https://www.bestpractices.dev/projects/8256)
89
[![OpenSSF Scorecard](https://api.securityscorecards.dev/projects/github.com/devfile/registry-operator/badge)](https://securityscorecards.dev/viewer/?uri=github.com/devfile/registry-operator)
@@ -48,7 +49,7 @@ security setups.
4849

4950
### Development
5051

51-
- Go 1.21.x
52+
- Go 1.22.x
5253
- Docker / Podman
5354
- Operator SDK 1.28.x
5455

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
module github.com/devfile/registry-operator
22

3-
go 1.21
3+
go 1.22
44

55
require (
66
github.com/devfile/registry-support/index/generator v0.0.0-20240816133831-cf509ccd1a6b

0 commit comments

Comments
 (0)