diff --git a/hack/tools.mk b/hack/tools.mk index 4819b528..88218a21 100644 --- a/hack/tools.mk +++ b/hack/tools.mk @@ -9,7 +9,7 @@ GOIMPORTS_REVISER_VERSION ?= v3.12.6 # renovate: datasource=github-releases depName=ko-build/ko KO_VERSION ?= v0.18.1 # renovate: datasource=github-releases depName=golangci/golangci-lint -GOLANGCI_LINT_VERSION ?= v2.11.4 +GOLANGCI_LINT_VERSION ?= v2.12.2 # Tool targets should declare go.mod as a prerequisite, if the tool's version is managed via go modules. This causes # make to rebuild the tool in the desired version, when go.mod is changed. @@ -37,4 +37,4 @@ $(KO): $(call tool_version_file,$(KO),$(KO_VERSION)) GOLANGCI_LINT := $(TOOLS_BIN_DIR)/golangci-lint $(GOLANGCI_LINT): $(call tool_version_file,$(GOLANGCI_LINT),$(GOLANGCI_LINT_VERSION)) - curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(TOOLS_BIN_DIR) $(GOLANGCI_LINT_VERSION) \ No newline at end of file + GOBIN=$(abspath $(TOOLS_BIN_DIR)) go install github.com/golangci/golangci-lint/v2/cmd/golangci-lint@$(GOLANGCI_LINT_VERSION) \ No newline at end of file diff --git a/test/e2e/e2e_suite_test.go b/test/e2e/e2e_suite_test.go index ed587d6b..d2d89046 100644 --- a/test/e2e/e2e_suite_test.go +++ b/test/e2e/e2e_suite_test.go @@ -5,6 +5,7 @@ import ( "fmt" "os" "os/exec" + "slices" "testing" . "github.com/onsi/ginkgo/v2" @@ -89,8 +90,7 @@ var _ = AfterSuite(func(ctx context.Context) { _, _ = fmt.Fprintf(GinkgoWriter, "MCM uninstall output: %s\n", string(output)) By("cleaning up tracked test resources after MCM removal") - for i := len(testResources) - 1; i >= 0; i-- { - resource := testResources[i] + for _, resource := range slices.Backward(testResources) { // Wrap each cleanup in a function with GinkgoRecover to prevent one failure // from stopping cleanup of remaining resources func(res TestResource) {