mirror of https://github.com/k3s-io/k3s
Merge pull request #59989 from mtaufen/fix-e2e-node-tests
Automatic merge from submit-queue (batch tested with PRs 59927, 59989, 59950). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. Fix e2e node setKubeletConfiguration helper The helper should have been using `apiequality.Semantic.DeepEqual`, instead of `reflect.DeepEqual`. Previously, nil vs empty containers were treated as not equal, but they should be considered equal for objects managed by Kubernetes API machinery, like KubeletConfiguration. This should fix the failing eviction tests. ```release-note NONE ```pull/6/head
commit
1e5a58416b
|
@ -51,6 +51,7 @@ go_library(
|
|||
"//vendor/github.com/onsi/gomega:go_default_library",
|
||||
"//vendor/github.com/prometheus/common/model:go_default_library",
|
||||
"//vendor/k8s.io/api/core/v1:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/equality:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/errors:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/api/resource:go_default_library",
|
||||
"//vendor/k8s.io/apimachinery/pkg/apis/meta/v1:go_default_library",
|
||||
|
|
|
@ -23,7 +23,6 @@ import (
|
|||
"io/ioutil"
|
||||
"net/http"
|
||||
"os/exec"
|
||||
"reflect"
|
||||
"regexp"
|
||||
"strings"
|
||||
"time"
|
||||
|
@ -31,6 +30,7 @@ import (
|
|||
"github.com/golang/glog"
|
||||
|
||||
apiv1 "k8s.io/api/core/v1"
|
||||
apiequality "k8s.io/apimachinery/pkg/api/equality"
|
||||
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
|
||||
"k8s.io/apimachinery/pkg/runtime"
|
||||
"k8s.io/apimachinery/pkg/util/sets"
|
||||
|
@ -110,7 +110,7 @@ func tempSetCurrentKubeletConfig(f *framework.Framework, updateFunction func(ini
|
|||
framework.ExpectNoError(err)
|
||||
newCfg := oldCfg.DeepCopy()
|
||||
updateFunction(newCfg)
|
||||
if reflect.DeepEqual(*newCfg, *oldCfg) {
|
||||
if apiequality.Semantic.DeepEqual(*newCfg, *oldCfg) {
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -185,7 +185,7 @@ func setKubeletConfiguration(f *framework.Framework, kubeCfg *kubeletconfig.Kube
|
|||
if err != nil {
|
||||
return fmt.Errorf("failed trying to get current Kubelet config, will retry, error: %v", err)
|
||||
}
|
||||
if !reflect.DeepEqual(*kubeCfg, *newKubeCfg) {
|
||||
if !apiequality.Semantic.DeepEqual(*kubeCfg, *newKubeCfg) {
|
||||
return fmt.Errorf("still waiting for new configuration to take effect, will continue to watch /configz")
|
||||
}
|
||||
glog.Infof("new configuration has taken effect")
|
||||
|
|
Loading…
Reference in New Issue