From ac4d576df8831c0c399ee8fff1e85469e90b8c44 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Thu, 12 May 2022 14:08:40 +0000 Subject: [PATCH 1/3] Update e2e test versions --- Makefile | 4 ++-- hack/verify-gofmt.sh | 2 +- test/run-e2e-tests.sh | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 84c729bb4..871dd618a 100644 --- a/Makefile +++ b/Makefile @@ -24,7 +24,7 @@ ARCHS = amd64 arm arm64 LDFLAGS=-ldflags "-X ${LDFLAG_LOCATION}.version=${VERSION} -X ${LDFLAG_LOCATION}.buildDate=${BUILD} -X ${LDFLAG_LOCATION}.gitbranch=${BRANCH} -X ${LDFLAG_LOCATION}.gitsha1=${SHA1}" -GOLANGCI_VERSION := v1.43.0 +GOLANGCI_VERSION := v1.46.1 HAS_GOLANGCI := $(shell ls _output/bin/golangci-lint 2> /dev/null) # REGISTRY is the container registry to push @@ -144,4 +144,4 @@ test-helm: ensure-helm-install ensure-helm-install: ifndef HAS_HELM curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 && chmod 700 ./get_helm.sh && ./get_helm.sh -endif \ No newline at end of file +endif diff --git a/hack/verify-gofmt.sh b/hack/verify-gofmt.sh index 79f5e7f11..2e70cf104 100755 --- a/hack/verify-gofmt.sh +++ b/hack/verify-gofmt.sh @@ -23,7 +23,7 @@ DESCHEDULER_ROOT=$(dirname "${BASH_SOURCE}")/.. GO_VERSION=($(go version)) -if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.14|go1.15|go1.16|go1.17') ]]; then +if [[ -z $(echo "${GO_VERSION[2]}" | grep -E 'go1.14|go1.15|go1.16|go1.17|go1.18') ]]; then echo "Unknown go version '${GO_VERSION[2]}', skipping gofmt." exit 1 fi diff --git a/test/run-e2e-tests.sh b/test/run-e2e-tests.sh index 19c30d539..3e24e96e8 100755 --- a/test/run-e2e-tests.sh +++ b/test/run-e2e-tests.sh @@ -20,9 +20,9 @@ set -o nounset # This just runs e2e tests. if [ -n "$KIND_E2E" ]; then - K8S_VERSION=${KUBERNETES_VERSION:-v1.21.1} + K8S_VERSION=${KUBERNETES_VERSION:-v1.24.0} curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/${K8S_VERSION}/bin/linux/amd64/kubectl && chmod +x kubectl && mv kubectl /usr/local/bin/ - wget https://github.com/kubernetes-sigs/kind/releases/download/v0.11.0/kind-linux-amd64 + wget https://github.com/kubernetes-sigs/kind/releases/download/v0.13.0/kind-linux-amd64 chmod +x kind-linux-amd64 mv kind-linux-amd64 kind export PATH=$PATH:$PWD From fb1df468ada2ab94896deeab902dd10464950ad8 Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Thu, 12 May 2022 14:21:34 +0000 Subject: [PATCH 2/3] golint fix --- pkg/descheduler/strategies/nodeutilization/nodeutilization.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/descheduler/strategies/nodeutilization/nodeutilization.go b/pkg/descheduler/strategies/nodeutilization/nodeutilization.go index 87f2ac34f..9c155851d 100644 --- a/pkg/descheduler/strategies/nodeutilization/nodeutilization.go +++ b/pkg/descheduler/strategies/nodeutilization/nodeutilization.go @@ -75,7 +75,7 @@ func validateNodeUtilizationParams(params *api.StrategyParameters) error { // validateThresholds checks if thresholds have valid resource name and resource percentage configured func validateThresholds(thresholds api.ResourceThresholds) error { - if thresholds == nil || len(thresholds) == 0 { + if len(thresholds) == 0 { return fmt.Errorf("no resource threshold is configured") } for name, percent := range thresholds { From 6e84d0a6ba81c9355e5e1b8a82193040b4a9888d Mon Sep 17 00:00:00 2001 From: Mike Dame Date: Thu, 12 May 2022 15:35:07 +0000 Subject: [PATCH 3/3] React to removal of offensive language https://github.com/kubernetes/kubeadm/issues/2200 went into effect in 1.24, so e2es broke without the update. --- pkg/descheduler/strategies/duplicates_test.go | 8 ++++---- test/e2e/e2e_test.go | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pkg/descheduler/strategies/duplicates_test.go b/pkg/descheduler/strategies/duplicates_test.go index 488bc4a3e..1c5e4d695 100644 --- a/pkg/descheduler/strategies/duplicates_test.go +++ b/pkg/descheduler/strategies/duplicates_test.go @@ -378,7 +378,7 @@ func TestRemoveDuplicatesUniformly(t *testing.T) { node.Spec.Taints = []v1.Taint{ { Effect: v1.TaintEffectNoSchedule, - Key: "node-role.kubernetes.io/master", + Key: "node-role.kubernetes.io/control-plane", }, } } @@ -387,7 +387,7 @@ func TestRemoveDuplicatesUniformly(t *testing.T) { if node.ObjectMeta.Labels == nil { node.ObjectMeta.Labels = map[string]string{} } - node.ObjectMeta.Labels["node-role.kubernetes.io/master"] = "" + node.ObjectMeta.Labels["node-role.kubernetes.io/control-plane"] = "" } setWorkerLabel := func(node *v1.Node) { @@ -407,7 +407,7 @@ func TestRemoveDuplicatesUniformly(t *testing.T) { { MatchExpressions: []v1.NodeSelectorRequirement{ { - Key: "node-role.kubernetes.io/master", + Key: "node-role.kubernetes.io/control-plane", Operator: v1.NodeSelectorOpDoesNotExist, }, { @@ -431,7 +431,7 @@ func TestRemoveDuplicatesUniformly(t *testing.T) { { MatchExpressions: []v1.NodeSelectorRequirement{ { - Key: "node-role.kubernetes.io/master", + Key: "node-role.kubernetes.io/control-plane", Operator: v1.NodeSelectorOpDoesNotExist, }, { diff --git a/test/e2e/e2e_test.go b/test/e2e/e2e_test.go index 88a945ec3..ff928cbe8 100644 --- a/test/e2e/e2e_test.go +++ b/test/e2e/e2e_test.go @@ -1331,7 +1331,7 @@ func splitNodesAndWorkerNodes(nodes []v1.Node) ([]*v1.Node, []*v1.Node) { for i := range nodes { node := nodes[i] allNodes = append(allNodes, &node) - if _, exists := node.Labels["node-role.kubernetes.io/master"]; !exists { + if _, exists := node.Labels["node-role.kubernetes.io/control-plane"]; !exists { workerNodes = append(workerNodes, &node) } }