From 7fa3d54ea5befd402c901792b5ab3fe456abb94b Mon Sep 17 00:00:00 2001 From: Claudiu Belu Date: Thu, 6 Apr 2023 08:50:10 +0000 Subject: [PATCH] unittests: Fixes server journal unit test on Windows The Boot option for the node log query is not supported on Windows and an error is returned if the option is set. Because of this, one of the unit tests which sets the option fails, as it does not expect any errror. --- pkg/kubelet/kubelet_server_journal_test.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/kubelet_server_journal_test.go b/pkg/kubelet/kubelet_server_journal_test.go index e431eaaf2e0..bdcf14a41bb 100644 --- a/pkg/kubelet/kubelet_server_journal_test.go +++ b/pkg/kubelet/kubelet_server_journal_test.go @@ -189,7 +189,8 @@ func Test_nodeLogQuery_validate(t *testing.T) { {name: "until", Services: []string{service1}, options: options{UntilTime: &until}}, {name: "since until", Services: []string{service1}, options: options{SinceTime: &until, UntilTime: &since}, wantErr: true}, - {name: "boot", Services: []string{service1}, options: options{Boot: intPtr(-1)}}, + // boot is not supported on Windows. + {name: "boot", Services: []string{service1}, options: options{Boot: intPtr(-1)}, wantErr: runtime.GOOS == "windows"}, {name: "boot out of range", Services: []string{service1}, options: options{Boot: intPtr(1)}, wantErr: true}, {name: "tailLines", Services: []string{service1}, options: options{TailLines: intPtr(100)}}, {name: "tailLines out of range", Services: []string{service1}, options: options{TailLines: intPtr(100000)}},