@@ -93,24 +93,15 @@ var _ = SIGDescribe("Node Container Manager [Serial]", func() {
93
93
ginkgo .DeferCleanup (func (ctx context.Context ) {
94
94
if oldCfg != nil {
95
95
// Update the Kubelet configuration.
96
- ginkgo .By ("Stopping the kubelet" )
97
- startKubelet := stopKubelet ()
98
-
99
- // wait until the kubelet health check will fail
100
- gomega .Eventually (ctx , func () bool {
101
- return kubeletHealthCheck (kubeletHealthCheckURL )
102
- }).WithTimeout (time .Minute ).WithPolling (time .Second ).Should (gomega .BeFalseBecause ("expected kubelet health check to be failed" ))
103
- ginkgo .By ("Stopped the kubelet" )
104
-
105
96
framework .ExpectNoError (e2enodekubelet .WriteKubeletConfigFile (oldCfg ))
106
97
107
- ginkgo .By ("Starting the kubelet" )
108
- startKubelet ( )
98
+ ginkgo .By ("Restarting the kubelet" )
99
+ restartKubelet ( true )
109
100
110
101
// wait until the kubelet health check will succeed
111
102
gomega .Eventually (ctx , func (ctx context.Context ) bool {
112
103
return kubeletHealthCheck (kubeletHealthCheckURL )
113
- }).WithTimeout (2 * time .Minute ).WithPolling (5 * time .Second ).Should (gomega .BeTrueBecause ( "expected kubelet to be in healthy state" ))
104
+ }).WithTimeout (2 * time .Minute ).WithPolling (5 * time .Second ).Should (gomega .BeTrue ( ))
114
105
ginkgo .By ("Started the kubelet" )
115
106
}
116
107
})
@@ -121,29 +112,20 @@ var _ = SIGDescribe("Node Container Manager [Serial]", func() {
121
112
newCfg .CgroupDriver = "systemd"
122
113
123
114
// Update the Kubelet configuration.
124
- ginkgo .By ("Stopping the kubelet" )
125
- startKubelet := stopKubelet ()
126
-
127
- // wait until the kubelet health check will fail
128
- gomega .Eventually (ctx , func () bool {
129
- return kubeletHealthCheck (kubeletHealthCheckURL )
130
- }).WithTimeout (time .Minute ).WithPolling (time .Second ).Should (gomega .BeFalseBecause ("expected kubelet health check to be failed" ))
131
- ginkgo .By ("Stopped the kubelet" )
132
-
133
115
framework .ExpectNoError (e2enodekubelet .WriteKubeletConfigFile (newCfg ))
134
116
135
- ginkgo .By ("Starting the kubelet" )
136
- startKubelet ( )
117
+ ginkgo .By ("Restarting the kubelet" )
118
+ restartKubelet ( true )
137
119
138
120
// wait until the kubelet health check will succeed
139
- gomega .Eventually (ctx , func () bool {
140
- return getNodeReadyStatus ( ctx , f ) && kubeletHealthCheck (kubeletHealthCheckURL )
141
- }).WithTimeout (2 * time .Minute ).WithPolling (5 * time .Second ).Should (gomega .BeTrueBecause ( "expected kubelet to be in healthy state" ))
121
+ gomega .Eventually (ctx , func (ctx context. Context ) bool {
122
+ return kubeletHealthCheck (kubeletHealthCheckURL )
123
+ }).WithTimeout (2 * time .Minute ).WithPolling (5 * time .Second ).Should (gomega .BeTrue ( ))
142
124
ginkgo .By ("Started the kubelet" )
143
125
144
126
gomega .Consistently (ctx , func (ctx context.Context ) bool {
145
127
return getNodeReadyStatus (ctx , f ) && kubeletHealthCheck (kubeletHealthCheckURL )
146
- }).WithTimeout (2 * time .Minute ).WithPolling (2 * time .Second ).Should (gomega .BeTrueBecause ( "node keeps reporting ready status" ))
128
+ }).WithTimeout (2 * time .Minute ).WithPolling (2 * time .Second ).Should (gomega .BeTrue ( ))
147
129
})
148
130
})
149
131
})
0 commit comments