Skip to content

Commit

Permalink
chore: bump to go 1.21 and k8s 1.28 (open-policy-agent#2979)
Browse files Browse the repository at this point in the history
Signed-off-by: Sertac Ozercan <[email protected]>
  • Loading branch information
sozercan authored Oct 10, 2023
1 parent d916017 commit 7ff27dd
Show file tree
Hide file tree
Showing 14 changed files with 33 additions and 46 deletions.
5 changes: 0 additions & 5 deletions .github/workflows/dapr-pubsub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,6 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

- name: Set up Go 1.20
uses: actions/setup-go@v4
with:
go-version: 1.20

- name: Bootstrap e2e
run: |
mkdir -p $GITHUB_WORKSPACE/bin
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/license-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ jobs:
with:
egress-policy: audit

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
with:
egress-policy: audit

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Set release version and target branch for vNext
if: github.event_name == 'push'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Get tag
id: get_version
Expand Down
28 changes: 14 additions & 14 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ jobs:
with:
egress-policy: audit

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -61,10 +61,10 @@ jobs:
with:
egress-policy: audit

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -90,11 +90,11 @@ jobs:
egress-policy: audit

- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v3.5.2
- name: Set up Go 1.20
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.2
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"
- name: Check go.mod and manifests
run: |
# there should be no additional manifest or go.mod changes
Expand All @@ -113,10 +113,10 @@ jobs:
with:
egress-policy: audit

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608
Expand All @@ -136,7 +136,7 @@ jobs:
timeout-minutes: 15
strategy:
matrix:
KUBERNETES_VERSION: ["1.24.12", "1.25.8", "1.26.3", "1.27.1"]
KUBERNETES_VERSION: ["1.25.8", "1.26.3", "1.27.1", "1.28.0"]
steps:
- name: Harden Runner
uses: step-security/harden-runner@1b05615854632b887b69ae1be8cbefe72d3ae423 # v2.6.0
Expand All @@ -146,10 +146,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Bootstrap e2e
run: |
Expand Down Expand Up @@ -266,10 +266,10 @@ jobs:
- name: Check out code into the Go module directory
uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608

- name: Set up Go 1.20
- name: Set up Go
uses: actions/setup-go@v4 # v4.0.1
with:
go-version: "1.20"
go-version: "1.21"

- name: Bootstrap e2e
run: |
Expand Down
2 changes: 1 addition & 1 deletion .go-version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.20.0
1.21.0
2 changes: 1 addition & 1 deletion .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ linters-settings:
locale: US
staticcheck:
# Select the Go version to target. The default is '1.13'.
go: "1.20"
go: "1.21"

linters:
disable-all: true
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILDPLATFORM="linux/amd64"
ARG BUILDERIMAGE="golang:1.20-bullseye"
ARG BUILDERIMAGE="golang:1.21-bullseye"
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
ARG BASEIMAGE="gcr.io/distroless/static:nonroot"
Expand Down
6 changes: 1 addition & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ VERSION := v3.14.0-beta.0

KIND_VERSION ?= 0.17.0
# note: k8s version pinned since KIND image availability lags k8s releases
KUBERNETES_VERSION ?= 1.27.1
CRD_KUBECTL_VERSION ?= 1.27.1
KUBERNETES_VERSION ?= 1.28.0
KUSTOMIZE_VERSION ?= 3.8.9
BATS_VERSION ?= 1.8.2
ORAS_VERSION ?= 0.16.0
Expand Down Expand Up @@ -384,7 +383,6 @@ docker-buildx-crds: build-crds docker-buildx-builder
docker buildx build \
$(_ATTESTATIONS) \
--build-arg LDFLAGS=${LDFLAGS} \
--build-arg KUBE_VERSION=${CRD_KUBECTL_VERSION} \
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t $(CRD_IMG) \
Expand All @@ -403,7 +401,6 @@ docker-buildx-crds-dev: build-crds docker-buildx-builder
docker buildx build \
$(_ATTESTATIONS) \
--build-arg LDFLAGS=${LDFLAGS} \
--build-arg KUBE_VERSION=${CRD_KUBECTL_VERSION} \
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t $(CRD_REPOSITORY):$(DEV_TAG) \
Expand All @@ -422,7 +419,6 @@ docker-buildx-crds-release: build-crds docker-buildx-builder
docker buildx build \
$(_ATTESTATIONS) \
--build-arg LDFLAGS=${LDFLAGS}\
--build-arg KUBE_VERSION=${CRD_KUBECTL_VERSION} \
--platform="$(PLATFORM)" \
--output=$(OUTPUT_TYPE) \
-t $(CRD_REPOSITORY):$(VERSION) \
Expand Down
4 changes: 2 additions & 2 deletions Tiltfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ if settings.get("trigger_mode", "auto").lower() == "manual":
trigger_mode(TRIGGER_MODE_MANUAL)

TILT_DOCKERFILE = """
FROM golang:1.20-bullseye as tilt-helper
FROM golang:1.21-bullseye as tilt-helper
# Support live reloading with Tilt
RUN wget --output-document /restart.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/60eaa572cdf825c646008e1ea28b635f83cefb38/restart.sh && \
wget --output-document /start.sh --quiet https://raw.githubusercontent.com/tilt-dev/rerun-process-wrapper/60eaa572cdf825c646008e1ea28b635f83cefb38/start.sh && \
Expand Down Expand Up @@ -71,7 +71,7 @@ def build_crds():
context=".staging/crds/",
target="build",
only="crds",
build_args={"KUBE_VERSION": "1.27.1"},
build_args={"KUBE_VERSION": "1.28.0"},
live_update=[
sync(".staging/crds/", "/crds"),
],
Expand Down
10 changes: 3 additions & 7 deletions crd.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
FROM alpine as builder
FROM --platform=$TARGETPLATFORM registry.k8s.io/kubectl:v1.28.1 as builder

ARG TARGETPLATFORM
ARG TARGETOS
ARG TARGETARCH
ARG KUBE_VERSION

RUN apk add --no-cache curl && \
curl -LO https://dl.k8s.io/release/v${KUBE_VERSION}/bin/${TARGETOS}/${TARGETARCH}/kubectl && \
chmod +x kubectl

FROM scratch as build
USER 65532:65532
COPY --chown=65532:65532 * /crds/
COPY --from=builder /kubectl /kubectl
COPY --from=builder /bin/kubectl /kubectl
ENTRYPOINT ["/kubectl"]
2 changes: 1 addition & 1 deletion gator.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILDPLATFORM="linux/amd64"
ARG BUILDERIMAGE="golang:1.20-bullseye"
ARG BUILDERIMAGE="golang:1.21-bullseye"
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
ARG BASEIMAGE="gcr.io/distroless/static:nonroot"
Expand Down
2 changes: 1 addition & 1 deletion test/externaldata/dummy-provider/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILDPLATFORM="linux/amd64"
ARG BUILDERIMAGE="golang:1.20-bullseye"
ARG BUILDERIMAGE="golang:1.21-bullseye"
ARG BASEIMAGE="gcr.io/distroless/static:nonroot"

FROM --platform=$BUILDPLATFORM $BUILDERIMAGE as builder
Expand Down
4 changes: 2 additions & 2 deletions test/pubsub/fake-subscriber/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
ARG BUILDPLATFORM="linux/amd64"
ARG BUILDERIMAGE="golang:1.20-bullseye"
ARG BUILDERIMAGE="golang:1.21-bullseye"
ARG BASEIMAGE="gcr.io/distroless/static:nonroot"

FROM --platform=$BUILDPLATFORM $BUILDERIMAGE as builder
Expand Down Expand Up @@ -28,7 +28,7 @@ FROM $BASEIMAGE

WORKDIR /

COPY --from=builder /go/src/github.com/open-policy-agent/gatekeeper/test/pubsub/fake-subscriber/main .
COPY --from=builder /go/src/github.com/open-policy-agent/gatekeeper/test/pubsub/fake-subscriber/main .

USER 65532:65532

Expand Down

0 comments on commit 7ff27dd

Please sign in to comment.