diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 77d2f1b49..f59fcfd72 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -18,4 +18,4 @@ jobs: - name: golangci-lint uses: golangci/golangci-lint-action@v3 with: - version: "v1.55" + version: v1.56 diff --git a/Makefile b/Makefile index 0bdcc770c..97ec6b3a9 100644 --- a/Makefile +++ b/Makefile @@ -71,7 +71,7 @@ ENVSUBST_VER := v1.4.2 ENVSUBST_BIN := envsubst ENVSUBST := $(TOOLS_BIN_DIR)/$(ENVSUBST_BIN) -GOLANGCI_LINT_VER := v1.55.2 +GOLANGCI_LINT_VER := v1.56.2 GOLANGCI_LINT_BIN := golangci-lint GOLANGCI_LINT := $(TOOLS_BIN_DIR)/$(GOLANGCI_LINT_BIN)-$(GOLANGCI_LINT_VER) @@ -176,7 +176,7 @@ SKIP_CLEANUP ?= false SKIP_CREATE_MGMT_CLUSTER ?= false .PHONY: test-e2e-run -test-e2e-run: $(ENVSUBST) $(KUBECTL) $(GINKGO) e2e-image ## Run the end-to-end tests +test-e2e-run: $(ENVSUBST) $(KUSTOMIZE) $(KUBECTL) $(GINKGO) e2e-image ## Run the end-to-end tests $(ENVSUBST) < $(E2E_CONF_FILE) > $(E2E_CONF_FILE_ENVSUBST) && \ time $(GINKGO) -v --trace -poll-progress-after=$(GINKGO_POLL_PROGRESS_AFTER) -poll-progress-interval=$(GINKGO_POLL_PROGRESS_INTERVAL) \ --tags=e2e --focus="$(GINKGO_FOCUS)" -skip="$(GINKGO_SKIP)" --nodes=$(GINKGO_NODES) --no-color=$(GINKGO_NOCOLOR) \ @@ -199,7 +199,7 @@ test-junit: $(SETUP_ENVTEST) $(GOTESTSUM) ## Run tests with verbose setting and exit $$(cat $(ARTIFACTS)/junit.exitcode) .PHONY: test-e2e -test-e2e: ## Run the end-to-end tests +test-e2e: $(KUSTOMIZE) ## Run the end-to-end tests $(MAKE) test-e2e-run LOCAL_GINKGO_ARGS ?= @@ -214,7 +214,7 @@ test-e2e-local: ## Run e2e tests CONFORMANCE_E2E_ARGS ?= -kubetest.config-file=$(KUBETEST_CONF_PATH) CONFORMANCE_E2E_ARGS += $(E2E_ARGS) .PHONY: test-conformance -test-conformance: ## Run conformance test on workload cluster. +test-conformance: $(KUSTOMIZE) ## Run conformance test on workload cluster. $(MAKE) test-e2e-run GINKGO_FOCUS="Conformance Tests" E2E_ARGS='$(CONFORMANCE_E2E_ARGS)' GINKGO_ARGS='$(LOCAL_GINKGO_ARGS)' ## -------------------------------------- @@ -287,6 +287,8 @@ $(GO_APIDIFF_BIN): $(GO_APIDIFF) .PHONY: $(KIND_BIN) $(KIND_BIN): $(KIND) ## Building Kind from tools folder +.PHONY: $(KUSTOMIZE_BIN) +$(KUSTOMIZE_BIN): $(KUSTOMIZE) ## Building kustomize from tools folder ## -------------------------------------- ## Linting diff --git a/hack/ensure-kustomize.sh b/hack/ensure-kustomize.sh deleted file mode 100644 index 509676211..000000000 --- a/hack/ensure-kustomize.sh +++ /dev/null @@ -1,54 +0,0 @@ -#!/usr/bin/env bash - -# Copyright 2019 The Kubernetes Authors. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. - -set -o errexit -set -o nounset -set -o pipefail - -GOPATH_BIN="$(go env GOPATH)/bin/" -MINIMUM_KUSTOMIZE_VERSION=3.1.0 - -# Ensure the kustomize tool exists and is a viable version, or installs it -verify_kustomize_version() { - - # If kustomize is not available on the path, get it - if ! [ -x "$(command -v kustomize)" ]; then - if [[ "${OSTYPE}" == "linux"* ]]; then - echo 'kustomize not found, installing' - if ! [ -d "${GOPATH_BIN}" ]; then - mkdir -p "${GOPATH_BIN}" - fi - curl -sLo "${GOPATH_BIN}/kustomize" https://github.com/kubernetes-sigs/kustomize/releases/download/v${MINIMUM_KUSTOMIZE_VERSION}/kustomize_${MINIMUM_KUSTOMIZE_VERSION}_linux_amd64 - chmod +x "${GOPATH_BIN}/kustomize" - else - echo "Missing required binary in path: kustomize" - return 2 - fi - fi - - local kustomize_version - kustomize_version=$(kustomize version) - if [[ "${MINIMUM_KUSTOMIZE_VERSION}" != $(echo -e "${MINIMUM_KUSTOMIZE_VERSION}\n${kustomize_version}" | sort -s -t. -k 1,1 -k 2,2n -k 3,3n | head -n1) ]]; then - cat <