Skip to content

Commit aab1bef

Browse files
authored
Merge pull request kubernetes#86519 from SataQiu/re-enable-kubelet-version-check
kubeadm: re-enable kubelet version check test in preflight
2 parents 4f70231 + 107db83 commit aab1bef

File tree

2 files changed

+2
-12
lines changed

2 files changed

+2
-12
lines changed

cmd/kubeadm/app/preflight/checks_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -671,11 +671,6 @@ func restoreEnv(e map[string]string) {
671671
}
672672

673673
func TestKubeletVersionCheck(t *testing.T) {
674-
// TODO: Re-enable this test
675-
// fakeexec.FakeCmd supports only combined output.
676-
// Hence .Output() returns a "not supported" error and we cannot use it for the test ATM.
677-
t.Skip()
678-
679674
cases := []struct {
680675
kubeletVersion string
681676
k8sVersion string
@@ -694,7 +689,7 @@ func TestKubeletVersionCheck(t *testing.T) {
694689
for _, tc := range cases {
695690
t.Run(tc.kubeletVersion, func(t *testing.T) {
696691
fcmd := fakeexec.FakeCmd{
697-
CombinedOutputScript: []fakeexec.FakeAction{
692+
OutputScript: []fakeexec.FakeAction{
698693
func() ([]byte, []byte, error) { return []byte("Kubernetes " + tc.kubeletVersion), nil, nil },
699694
},
700695
}

cmd/kubeadm/app/preflight/utils_test.go

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,11 +26,6 @@ import (
2626
)
2727

2828
func TestGetKubeletVersion(t *testing.T) {
29-
// TODO: Re-enable this test
30-
// fakeexec.FakeCmd supports only combined output.
31-
// Hence .Output() returns a "not supported" error and we cannot use it for the test ATM.
32-
t.Skip()
33-
3429
cases := []struct {
3530
output string
3631
expected string
@@ -47,7 +42,7 @@ func TestGetKubeletVersion(t *testing.T) {
4742
for _, tc := range cases {
4843
t.Run(tc.output, func(t *testing.T) {
4944
fcmd := fakeexec.FakeCmd{
50-
CombinedOutputScript: []fakeexec.FakeAction{
45+
OutputScript: []fakeexec.FakeAction{
5146
func() ([]byte, []byte, error) { return []byte(tc.output), nil, tc.err },
5247
},
5348
}

0 commit comments

Comments
 (0)