Skip to content

Commit

Permalink
🌱 Upgrade to Go 1.22 (#1438)
Browse files Browse the repository at this point in the history
  • Loading branch information
guettli authored Aug 13, 2024
1 parent 9af2b9c commit 24b39fa
Show file tree
Hide file tree
Showing 19 changed files with 22 additions and 633 deletions.
2 changes: 1 addition & 1 deletion .builder-image-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.19
1.0.20
2 changes: 1 addition & 1 deletion .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.21"
"go": "1.22"
},
packageRules: [
{
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/main-promote-builder-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Promote Latest tag to Caph Builder Image
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.19
image: ghcr.io/syself/caph-builder:1.0.20
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/pr-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:
if: github.event_name != 'pull_request_target' || !github.event.pull_request.draft
runs-on: ubuntu-latest
container:
image: ghcr.io/syself/caph-builder:1.0.19
image: ghcr.io/syself/caph-builder:1.0.20
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand All @@ -32,6 +32,7 @@ jobs:
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0

- name: Fixup git permissions
# https://github.com/actions/checkout/issues/766
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedule-scan-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest
if: github.repository == 'syself/cluster-api-provider-hetzner'
container:
image: ghcr.io/syself/caph-builder:1.0.19
image: ghcr.io/syself/caph-builder:1.0.20
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
Expand Down
8 changes: 4 additions & 4 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.21"
go: "1.22"
stylecheck:
go: "1.21"
go: "1.22"
gocritic:
enabled-tags:
- diagnostic
Expand Down Expand Up @@ -224,7 +224,7 @@ linters-settings:
- ["ID"] # AllowList
- ["VM"] # DenyList
unused:
go: "1.21"
go: "1.22"
usestdlibvars:
# Suggest the use of http.MethodXX.
# Default: true
Expand Down Expand Up @@ -282,7 +282,7 @@ issues:
exclude-use-default: false
run:
timeout: 10m
go: "1.21"
go: "1.22"
allow-parallel-runners: true
modules-download-mode: vendor
skip-dirs:
Expand Down
4 changes: 2 additions & 2 deletions .golangci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ linters-settings:
- rangeValCopy
- hugeParam
unused:
go: "1.21"
go: "1.22"
issues:
max-same-issues: 0
max-issues-per-linter: 0
Expand Down Expand Up @@ -213,4 +213,4 @@ run:
- "test"
allow-parallel-runners: true
modules-download-mode: readonly
go: '1.21'
go: "1.22"
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.21
go 1.22

require (
github.com/blang/semver/v4 v4.0.0
Expand Down
15 changes: 7 additions & 8 deletions hack/golang-modules-update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,16 @@
# See the License for the specific language governing permissions and
# limitations under the License.

set -o errexit
set -o nounset
set -o pipefail
trap 'echo "ERROR: A command has failed. Exiting the script. Line was ($0:$LINENO): $(sed -n "${LINENO}p" "$0")"; exit 3' ERR
set -Eeuo pipefail

REPO_ROOT=$(realpath $(dirname "${BASH_SOURCE[0]}")/..)
REPO_ROOT=$(realpath "$(dirname "${BASH_SOURCE[0]}")/..")
cd "${REPO_ROOT}" || exit 1

DIRS="./ ./hack/tools"
for DIR in ${DIRS}; do
cd ${REPO_ROOT}/${DIR} && go mod download
cd ${REPO_ROOT}/${DIR} && go mod verify
cd ${REPO_ROOT}/${DIR} && go mod tidy
cd ${REPO_ROOT}/${DIR} && go mod vendor
cd "${REPO_ROOT}/${DIR}" && go mod download
cd "${REPO_ROOT}/${DIR}" && go mod verify
cd "${REPO_ROOT}/${DIR}" && go mod tidy
cd "${REPO_ROOT}/${DIR}" && go mod vendor
done
2 changes: 1 addition & 1 deletion images/builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ FROM docker.io/aquasec/trivy:0.54.1@sha256:e654e95e0753d2daeb4d5b1c2791eee6a1262
############################
# Caph Build Image Base #
############################
FROM docker.io/library/golang:1.21.5-bullseye@sha256:1e3c713a9f5419786d85d0feb343ceff119d0f82f7ab0fefffa4150420c3ad7f
FROM docker.io/library/golang:1.22.6-bullseye@sha256:825f81571780b54e553c4d7f21081efd47cd125dd7a8b3343a4591aa02f4816a

# update: datasource=repology depName=debian_11/skopeo versioning=loose
ENV SKOPEO_VERSION="1.2.2+dfsg1-1+b6"
Expand Down
2 changes: 1 addition & 1 deletion 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.21.6-bullseye@sha256:c62751ac12cad0c514d941e36f846c1c440ca9e8ec08dd87d022fb03f0887a9b AS build
FROM --platform=${BUILDPLATFORM} docker.io/library/golang:1.22.6-bullseye@sha256:825f81571780b54e553c4d7f21081efd47cd125dd7a8b3343a4591aa02f4816a AS build
ARG TARGETOS TARGETARCH

COPY . /src/cluster-api-provider-hetzner
Expand Down

This file was deleted.

Loading

0 comments on commit 24b39fa

Please sign in to comment.