From 745c93af51217530b6813fe8db193ba65305de60 Mon Sep 17 00:00:00 2001 From: Ryan Richard Date: Fri, 13 Feb 2026 15:17:21 -0800 Subject: [PATCH] upgrade linter --- hack/install-linter.sh | 17 ++++++----------- hack/lib/lint-version.txt | 2 +- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/hack/install-linter.sh b/hack/install-linter.sh index 962e195a4..6942067ec 100755 --- a/hack/install-linter.sh +++ b/hack/install-linter.sh @@ -1,6 +1,6 @@ #!/usr/bin/env bash -# Copyright 2022-2025 the Pinniped contributors. All Rights Reserved. +# Copyright 2022-2026 the Pinniped contributors. All Rights Reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -13,19 +13,14 @@ go version lint_version="v$(cat hack/lib/lint-version.txt)" -# Find the toolchain version from our go.mod file. "go install" pays attention to $GOTOOLCHAIN. -GOTOOLCHAIN=$(sed -rn 's/^toolchain (go[0-9\.]+)$/\1/p' go.mod) +# Find the Go version from our Dockerfile. "go install" pays attention to $GOTOOLCHAIN. +GOTOOLCHAIN=$(sed -rn 's/^ARG BUILD_IMAGE=golang:([0-9\.]+)@sha256:.*$/\1/p' Dockerfile) if [[ -z "$GOTOOLCHAIN" ]]; then - # Did not find toolchain directive. The directive is not needed in a go.mod file when it would be the same - # version as the go directive, so it will not always be there. Try using go directive instead. - GOTOOLCHAIN=$(sed -rn 's/^go ([0-9]+\.[0-9]+\.[0-9]+)$/\1/p' go.mod) - if [[ -z "$GOTOOLCHAIN" ]]; then - echo "ERROR: Could not find Go patch version from go.mod file." - exit 1 - fi - GOTOOLCHAIN="go${GOTOOLCHAIN}" + echo "ERROR: Could not find Go patch version from Dockerfile." + exit 1 fi +GOTOOLCHAIN="go${GOTOOLCHAIN}" export GOTOOLCHAIN echo "Installing golangci-lint@${lint_version} using toolchain ${GOTOOLCHAIN}" diff --git a/hack/lib/lint-version.txt b/hack/lib/lint-version.txt index 37c2961c2..c8e38b614 100644 --- a/hack/lib/lint-version.txt +++ b/hack/lib/lint-version.txt @@ -1 +1 @@ -2.7.2 +2.9.0