@@ -18,6 +18,7 @@ package windows
18
18
19
19
import (
20
20
"context"
21
+ "strconv"
21
22
"time"
22
23
23
24
"github.com/onsi/ginkgo/v2"
@@ -50,7 +51,8 @@ var _ = sigDescribe(feature.Windows, "[Excluded:WindowsDocker] [MinimumKubeletVe
50
51
framework .ExpectNoError (err , "Error finding Windows node" )
51
52
framework .Logf ("Using node: %v" , targetNode .Name )
52
53
53
- bootID := targetNode .Status .NodeInfo .BootID
54
+ bootID , err := strconv .Atoi (targetNode .Status .NodeInfo .BootID )
55
+ framework .ExpectNoError (err , "Error converting bootID to int" )
54
56
windowsImage := imageutils .GetE2EImage (imageutils .Agnhost )
55
57
56
58
// Create Windows pod on the selected Windows node Using Agnhost
@@ -178,12 +180,17 @@ var _ = sigDescribe(feature.Windows, "[Excluded:WindowsDocker] [MinimumKubeletVe
178
180
restartCount := 0
179
181
180
182
ginkgo .By ("Waiting for nodes to be rebooted" )
181
- gomega .Eventually (ctx , func (ctx context.Context ) string {
183
+ gomega .Eventually (ctx , func (ctx context.Context ) int {
182
184
refreshNode , err := f .ClientSet .CoreV1 ().Nodes ().Get (ctx , targetNode .Name , metav1.GetOptions {})
183
185
if err != nil {
184
- return ""
186
+ return - 1
187
+ }
188
+ num , err := strconv .Atoi (refreshNode .Status .NodeInfo .BootID ) // Attempt to convert empty string
189
+ if err != nil {
190
+ return - 1 // strconv.Atoi: parsing "": invalid syntax
191
+ } else {
192
+ return num
185
193
}
186
- return refreshNode .Status .NodeInfo .BootID
187
194
}).WithPolling (time .Second * 30 ).WithTimeout (time .Minute * 10 ).
188
195
Should (gomega .BeNumerically (">" , bootID ), "node was not rebooted" )
189
196
0 commit comments