diff --git a/go.mod b/go.mod index dcbf3739b2..d01b582d36 100644 --- a/go.mod +++ b/go.mod @@ -46,7 +46,7 @@ require ( k8s.io/gengo/v2 v2.0.0-20250922181213-ec3ebc5fd46b k8s.io/klog/v2 v2.130.1 k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 - knative.dev/hack v0.0.0-20260415233235-54d1312ccc91 + knative.dev/hack v0.0.0-20260416140237-504af4d2178f sigs.k8s.io/randfill v1.0.0 sigs.k8s.io/yaml v1.6.0 ) diff --git a/go.sum b/go.sum index 42447dd460..cc4ac30434 100644 --- a/go.sum +++ b/go.sum @@ -249,8 +249,8 @@ k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912 h1:Y3gxNAuB0OBLImH611+UDZ k8s.io/kube-openapi v0.0.0-20250910181357-589584f1c912/go.mod h1:kdmbQkyfwUagLfXIad1y2TdrjPFWp2Q89B3qkRwf/pQ= k8s.io/utils v0.0.0-20251002143259-bc988d571ff4 h1:SjGebBtkBqHFOli+05xYbK8YF1Dzkbzn+gDM4X9T4Ck= k8s.io/utils v0.0.0-20251002143259-bc988d571ff4/go.mod h1:OLgZIPagt7ERELqWJFomSt595RzquPNLL48iOWgYOg0= -knative.dev/hack v0.0.0-20260415233235-54d1312ccc91 h1:YkboMEJ48h7DxRQSPe2SePm1yKK0YYgrsQW5Mmc0SEk= -knative.dev/hack v0.0.0-20260415233235-54d1312ccc91/go.mod h1:L5RzHgbvam0u8QFHfzCX6MKxu/a/gIGEdaRBqNiVbl0= +knative.dev/hack v0.0.0-20260416140237-504af4d2178f h1:YTht2cGdhd++kSrhwcDutWpk1V1bi0vKpAs0h4xIjpw= +knative.dev/hack v0.0.0-20260416140237-504af4d2178f/go.mod h1:L5RzHgbvam0u8QFHfzCX6MKxu/a/gIGEdaRBqNiVbl0= pgregory.net/rapid v1.1.0 h1:CMa0sjHSru3puNx+J0MIAuiiEV4N0qj8/cMWGBBCsjw= pgregory.net/rapid v1.1.0/go.mod h1:PY5XlDGj0+V1FCq0o192FdRhpKHGTRIWBgqjDBTrq04= sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730 h1:IpInykpT6ceI+QxKBbEflcR5EXP7sU1kvOlxwZh5txg= diff --git a/test/logstream/v2/stream_test.go b/test/logstream/v2/stream_test.go index 7de7522ee5..b6282ab5b0 100644 --- a/test/logstream/v2/stream_test.go +++ b/test/logstream/v2/stream_test.go @@ -215,7 +215,7 @@ func TestNamespaceStream(t *testing.T) { logFuncInvoked := make(chan string) t.Cleanup(func() { close(logFuncInvoked) }) logFunc := func(format string, args ...interface{}) { - logFuncInvoked <- fmt.Sprintf(format, args) + logFuncInvoked <- fmt.Sprintf(format, args...) } ctx, cancel := context.WithCancel(context.Background()) diff --git a/vendor/knative.dev/hack/library.sh b/vendor/knative.dev/hack/library.sh index 6eb5667958..d5bcacab00 100644 --- a/vendor/knative.dev/hack/library.sh +++ b/vendor/knative.dev/hack/library.sh @@ -35,6 +35,13 @@ if [[ ! -v GOPATH ]]; then fi fi +# Pinned tool versions +readonly GUM_VERSION="v0.14.1" +readonly GOTESTSUM_VERSION="v1.13.0" +readonly GOTESTFMT_VERSION="v2.5.0" +readonly TERMINAL_TO_HTML_VERSION="v3.10.0" +readonly GO_LICENSES_VERSION="v2.0.1" + # Useful environment variables [[ -v PROW_JOB_ID ]] && IS_PROW=1 || IS_PROW=0 readonly IS_PROW @@ -265,7 +272,7 @@ function gum_banner() { # Simple info banner for logging purposes. function gum_style() { - go_run github.com/charmbracelet/gum@v0.14.1 style "$@" + go_run "github.com/charmbracelet/gum@${GUM_VERSION}" style "$@" } # Checks whether the given function exists. @@ -588,7 +595,7 @@ function report_go_test() { logfile="${logfile/.xml/.jsonl}" echo "Running go test with args: ${go_test_args[*]}" local gotest_retcode=0 - go_run gotest.tools/gotestsum@v1.13.0 \ + go_run "gotest.tools/gotestsum@${GOTESTSUM_VERSION}" \ --format "${GO_TEST_VERBOSITY:-testname}" \ --junitfile "${xml}" \ --junitfile-testsuite-name relative \ @@ -601,14 +608,14 @@ function report_go_test() { echo "Test log (JSONL) written to ${logfile}" ansilog="${logfile/.jsonl/-ansi.log}" - go_run github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@v2.5.0 \ + go_run "github.com/gotesttools/gotestfmt/v2/cmd/gotestfmt@${GOTESTFMT_VERSION}" \ -input "${logfile}" \ -showteststatus \ -nofail > "$ansilog" echo "Test log (ANSI) written to ${ansilog}" htmllog="${logfile/.jsonl/.html}" - go_run github.com/buildkite/terminal-to-html/v3/cmd/terminal-to-html@v3.10.0 \ + go_run "github.com/buildkite/terminal-to-html/v3/cmd/terminal-to-html@${TERMINAL_TO_HTML_VERSION}" \ --preview < "$ansilog" > "$htmllog" echo "Test log (HTML) written to ${htmllog}" @@ -921,13 +928,14 @@ function run_kntest() { } # Run go-licenses to check for forbidden licenses. +# Extra flags can be passed via the GO_LICENSES_FLAGS environment variable. function check_licenses() { # Pin GOTOOLCHAIN to the project's Go version so that go-licenses is # compiled with the same toolchain. GOTOOLCHAIN=auto (the go_run default) # may select a different Go, causing isStdLib() path mismatches. GOTOOLCHAIN="$(go env GOVERSION)" \ - go_run github.com/google/go-licenses/v2@v2.0.1 \ - check "${REPO_ROOT_DIR}/..." || \ + go_run "github.com/google/go-licenses/v2@${GO_LICENSES_VERSION}" \ + check ${GO_LICENSES_FLAGS:-} "${REPO_ROOT_DIR}/..." || \ { echo "--- FAIL: go-licenses failed the license check"; return 1; } } diff --git a/vendor/modules.txt b/vendor/modules.txt index ea1741b38d..3833ca1ca9 100644 --- a/vendor/modules.txt +++ b/vendor/modules.txt @@ -1068,7 +1068,7 @@ k8s.io/utils/lru k8s.io/utils/net k8s.io/utils/ptr k8s.io/utils/trace -# knative.dev/hack v0.0.0-20260415233235-54d1312ccc91 +# knative.dev/hack v0.0.0-20260416140237-504af4d2178f ## explicit; go 1.24 knative.dev/hack # sigs.k8s.io/json v0.0.0-20250730193827-2d320260d730