mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 20:53:33 +00:00
kubeadm: re-enable kubelet version check test in preflight
This commit is contained in:
parent
2d310b1321
commit
107db83839
@ -671,11 +671,6 @@ func restoreEnv(e map[string]string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func TestKubeletVersionCheck(t *testing.T) {
|
func TestKubeletVersionCheck(t *testing.T) {
|
||||||
// TODO: Re-enable this test
|
|
||||||
// fakeexec.FakeCmd supports only combined output.
|
|
||||||
// Hence .Output() returns a "not supported" error and we cannot use it for the test ATM.
|
|
||||||
t.Skip()
|
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
kubeletVersion string
|
kubeletVersion string
|
||||||
k8sVersion string
|
k8sVersion string
|
||||||
@ -694,7 +689,7 @@ func TestKubeletVersionCheck(t *testing.T) {
|
|||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
t.Run(tc.kubeletVersion, func(t *testing.T) {
|
t.Run(tc.kubeletVersion, func(t *testing.T) {
|
||||||
fcmd := fakeexec.FakeCmd{
|
fcmd := fakeexec.FakeCmd{
|
||||||
CombinedOutputScript: []fakeexec.FakeAction{
|
OutputScript: []fakeexec.FakeAction{
|
||||||
func() ([]byte, []byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil, nil },
|
func() ([]byte, []byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil, nil },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
@ -26,11 +26,6 @@ import (
|
|||||||
)
|
)
|
||||||
|
|
||||||
func TestGetKubeletVersion(t *testing.T) {
|
func TestGetKubeletVersion(t *testing.T) {
|
||||||
// TODO: Re-enable this test
|
|
||||||
// fakeexec.FakeCmd supports only combined output.
|
|
||||||
// Hence .Output() returns a "not supported" error and we cannot use it for the test ATM.
|
|
||||||
t.Skip()
|
|
||||||
|
|
||||||
cases := []struct {
|
cases := []struct {
|
||||||
output string
|
output string
|
||||||
expected string
|
expected string
|
||||||
@ -47,7 +42,7 @@ func TestGetKubeletVersion(t *testing.T) {
|
|||||||
for _, tc := range cases {
|
for _, tc := range cases {
|
||||||
t.Run(tc.output, func(t *testing.T) {
|
t.Run(tc.output, func(t *testing.T) {
|
||||||
fcmd := fakeexec.FakeCmd{
|
fcmd := fakeexec.FakeCmd{
|
||||||
CombinedOutputScript: []fakeexec.FakeAction{
|
OutputScript: []fakeexec.FakeAction{
|
||||||
func() ([]byte, []byte, error) { return []byte(tc.output), nil, tc.err },
|
func() ([]byte, []byte, error) { return []byte(tc.output), nil, tc.err },
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user