@@ -98,19 +98,10 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() {
98
98
ginkgo .DeferCleanup (func (ctx context.Context ) {
99
99
if oldCfg != nil {
100
100
// Update the Kubelet configuration.
101
- ginkgo .By ("Stopping the kubelet" )
102
- startKubelet := stopKubelet ()
103
-
104
- // wait until the kubelet health check will fail
105
- gomega .Eventually (ctx , func () bool {
106
- return kubeletHealthCheck (kubeletHealthCheckURL )
107
- }).WithTimeout (time .Minute ).WithPolling (time .Second ).Should (gomega .BeFalseBecause ("expected kubelet health check to be failed" ))
108
- ginkgo .By ("Stopped the kubelet" )
109
-
110
101
framework .ExpectNoError (e2enodekubelet .WriteKubeletConfigFile (oldCfg ))
111
102
112
- ginkgo .By ("Starting the kubelet" )
113
- startKubelet ( )
103
+ ginkgo .By ("Restarting the kubelet" )
104
+ restartKubelet ( true )
114
105
115
106
// wait until the kubelet health check will succeed
116
107
gomega .Eventually (ctx , func (ctx context.Context ) bool {
@@ -127,23 +118,14 @@ var _ = SIGDescribe("Node Container Manager", framework.WithSerial(), func() {
127
118
newCfg .FailCgroupV1 = true // extra safety. We want to avoid false negatives though, so we added the skip check earlier
128
119
129
120
// Update the Kubelet configuration.
130
- ginkgo .By ("Stopping the kubelet" )
131
- startKubelet := stopKubelet ()
132
-
133
- // wait until the kubelet health check will fail
134
- gomega .Eventually (ctx , func () bool {
135
- return kubeletHealthCheck (kubeletHealthCheckURL )
136
- }).WithTimeout (time .Minute ).WithPolling (time .Second ).Should (gomega .BeFalseBecause ("expected kubelet health check to be failed" ))
137
- ginkgo .By ("Stopped the kubelet" )
138
-
139
121
framework .ExpectNoError (e2enodekubelet .WriteKubeletConfigFile (newCfg ))
140
122
141
- ginkgo .By ("Starting the kubelet" )
142
- startKubelet ( )
123
+ ginkgo .By ("Restarting the kubelet" )
124
+ restartKubelet ( true )
143
125
144
126
// wait until the kubelet health check will succeed
145
- gomega .Eventually (ctx , func () bool {
146
- return getNodeReadyStatus ( ctx , f ) && kubeletHealthCheck (kubeletHealthCheckURL )
127
+ gomega .Eventually (ctx , func (ctx context. Context ) bool {
128
+ return kubeletHealthCheck (kubeletHealthCheckURL )
147
129
}).WithTimeout (2 * time .Minute ).WithPolling (5 * time .Second ).Should (gomega .BeTrueBecause ("expected kubelet to be in healthy state" ))
148
130
ginkgo .By ("Started the kubelet" )
149
131
0 commit comments