Skip to content

Commit

Permalink
Bump golang 1.20 => 1.21
Browse files Browse the repository at this point in the history
Signed-off-by: Aniruddha Basak <aniruddha.basak@syself.com>
  • Loading branch information
aniruddha2000 committed Sep 12, 2023
1 parent 758a28f commit 255b4c1
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/renovate/golang.json5
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
},
// https://docs.renovatebot.com/configuration-options/#constraints
"constraints": {
"go": "1.20"
"go": "1.21"
},
packageRules: [
{
Expand Down Expand Up @@ -41,4 +41,4 @@
enabled: false,
},
],
}
}
19 changes: 13 additions & 6 deletions .golangci-suggestions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ linters-settings:
allow-leading-space: false
require-specific: true
staticcheck:
go: "1.20"
go: "1.21"
stylecheck:
go: "1.20"
go: "1.21"
gocritic:
enabled-tags:
- diagnostic
Expand Down Expand Up @@ -151,7 +151,14 @@ linters-settings:
severity: warning
disabled: false
arguments:
- ["call-chain", "loop", "method-call", "recover", "immediate-recover", "return"] # yamllint disable-line rule:line-length
- [
"call-chain",
"loop",
"method-call",
"recover",
"immediate-recover",
"return",
] # yamllint disable-line rule:line-length
# https://github.com/mgechev/revive/blob/master/RULES_DESCRIPTIONS.md#exported
- name: exported
severity: warning
Expand Down Expand Up @@ -218,7 +225,7 @@ linters-settings:
- ["ID"] # AllowList
- ["VM"] # DenyList
unused:
go: "1.20"
go: "1.21"
usestdlibvars:
# Suggest the use of http.MethodXX.
# Default: true
Expand Down Expand Up @@ -276,8 +283,8 @@ issues:
exclude-use-default: false
run:
timeout: 10m
go: "1.20"
go: "1.21"
allow-parallel-runners: true
modules-download-mode: vendor
skip-dirs:
- vendor$
- vendor$
8 changes: 4 additions & 4 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ linters-settings:
allow-leading-space: false
require-specific: true
staticcheck:
go: "1.20"
go: "1.21"
stylecheck:
go: "1.20"
go: "1.21"
gosec:
excludes:
- G307 # Deferring unsafe method "Close" on type "\*os.File"
Expand Down Expand Up @@ -111,7 +111,7 @@ linters-settings:
- rangeValCopy
- hugeParam
unused:
go: "1.20"
go: "1.21"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down Expand Up @@ -205,4 +205,4 @@ run:
- "tilt_modules"
- "test"
allow-parallel-runners: true
modules-download-mode: readonly
modules-download-mode: readonly
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/syself/cluster-api-provider-hetzner

go 1.20
go 1.21

replace sigs.k8s.io/cluster-api => sigs.k8s.io/cluster-api v1.5.0

Expand Down
5 changes: 2 additions & 3 deletions hack/golang-modules-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,5 @@ DIRS="./ ./hack/tools"
for DIR in ${DIRS}; do
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod download
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod verify
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod tidy
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod vendor
done
cd ${REPO_ROOT}/${DIR} && GO111MODULE=on GOPROXY=https://proxy.golang.org go mod vendor
done
8 changes: 4 additions & 4 deletions images/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ RUN apk add --no-cache curl && \
FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as golangci
# update: datasource=github-tags depName=golangci/golangci-lint versioning=semver
ENV GOLANGCI_VERSION="v1.52.2"
WORKDIR /
WORKDIR /
# hadolint ignore=DL3018,DL4006
RUN apk add --no-cache curl && \
curl -sfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s ${GOLANGCI_VERSION}
Expand All @@ -45,7 +45,7 @@ FROM docker.io/aquasec/trivy:0.39.0@sha256:ab281f43ee11b8ea5443ca8897641441f04f1
############################
# Caph Build Image Base #
############################
FROM docker.io/library/golang:1.20.2-bullseye@sha256:2101aa981e68ab1e06e3d4ac35ae75ed122f0380e5331e3ae4ba7e811bf9d256
FROM docker.io/library/golang:1.21.1-bullseye@sha256:357be9f9e594a338ba16f54c4df16481e7e82533a6571cecaf22dca833622f91

# update: datasource=repology depName=debian_11/skopeo versioning=loose
ENV SKOPEO_VERSION="1.2.2+dfsg1-1+b6"
Expand All @@ -65,7 +65,7 @@ RUN apt-get update && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
pip install --no-cache-dir \
yamllint==${YAMLLINT_VERSION} \
yamlfixer-opt-nc==${YAMLFIXER_VERSION}
yamlfixer-opt-nc==${YAMLFIXER_VERSION}

COPY --from=lychee /usr/bin/lychee /usr/bin/lychee
COPY --from=golangci /bin/golangci-lint /usr/local/bin
Expand All @@ -76,4 +76,4 @@ ENV GOCACHE=/go/cache

COPY build.sh /
RUN chmod +x /build.sh
ENTRYPOINT ["/build.sh"]
ENTRYPOINT ["/build.sh"]
4 changes: 2 additions & 2 deletions images/caph/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# limitations under the License.

# Build the manager binary
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.20.5@sha256:fd9306e1c664bd49a11d4a4a04e41303430e069e437d137876e9290a555e06fb as build
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.21.1-bullseye@sha256:357be9f9e594a338ba16f54c4df16481e7e82533a6571cecaf22dca833622f91 as build
ARG TARGETOS TARGETARCH

COPY . /src/cluster-api-provider-hetzner
Expand All @@ -28,4 +28,4 @@ WORKDIR /
COPY --from=build /src/cluster-api-provider-hetzner/manager .
# Use uid of nonroot user (65532) because kubernetes expects numeric user when applying pod security policies
USER 65532
ENTRYPOINT ["/manager"]
ENTRYPOINT ["/manager"]

0 comments on commit 255b4c1

Please sign in to comment.