Skip to content

Commit b00daa0

Browse files
authored
Enable servicing reboot (#760)
* Revert "Disable servicing reboot (#684)" This reverts commit 68d74ec. * Revert "Disable servicing reboot unit test" This reverts commit 36c357e. * Revert "Disable flatcar node version e2e test" This reverts commit 7785fa8. * Revert "Disable servicing controller" This reverts commit 0e995ef.
1 parent 397f8fb commit b00daa0

File tree

3 files changed

+19
-23
lines changed

3 files changed

+19
-23
lines changed

pkg/controller/servicing/controller_test.go

+17-19
Original file line numberDiff line numberDiff line change
@@ -241,28 +241,26 @@ func TestServicingControllerReconcile(t *testing.T) {
241241
expectedReboot: false,
242242
expectedReplace: true,
243243
},
244-
/*
245-
{
246-
message: "Nodes with outdate OS should be rebooted",
247-
options: &FakeKlusterOptions{
248-
Phase: models.KlusterPhaseRunning,
249-
LastService: nil,
250-
NodePools: []FakeNodePoolOptions{
251-
{
252-
AllowReboot: true,
253-
AllowReplace: true,
254-
NodeHealthy: true,
255-
NodeOSOutdated: true,
256-
NodeKubeletOutdated: false,
257-
Size: 1,
258-
},
244+
{
245+
message: "Nodes with outdate OS should be rebooted",
246+
options: &FakeKlusterOptions{
247+
Phase: models.KlusterPhaseRunning,
248+
LastService: nil,
249+
NodePools: []FakeNodePoolOptions{
250+
{
251+
AllowReboot: true,
252+
AllowReplace: true,
253+
NodeHealthy: true,
254+
NodeOSOutdated: true,
255+
NodeKubeletOutdated: false,
256+
Size: 1,
259257
},
260258
},
261-
expectedDrain: true,
262-
expectedReboot: true,
263-
expectedReplace: false,
264259
},
265-
*/
260+
expectedDrain: true,
261+
expectedReboot: true,
262+
expectedReplace: false,
263+
},
266264
{
267265
message: "Up-to-date Node should neither be rebooted nor be replaced",
268266
options: &FakeKlusterOptions{

pkg/controller/servicing/reconciler.go

+1-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import (
55

66
"github.com/go-kit/kit/log"
77
"github.com/pkg/errors"
8-
core_v1 "k8s.io/api/core/v1"
98
"k8s.io/client-go/tools/record"
109

1110
"github.com/sapcc/kubernikus/pkg/api/models"
@@ -155,8 +154,7 @@ func (r *KlusterReconciler) Do() error {
155154

156155
update := r.Lister.Updating()
157156
replace := r.Lister.Replace()
158-
//reboot := r.Lister.Reboot()
159-
reboot := make([]*core_v1.Node, 0)
157+
reboot := r.Lister.Reboot()
160158

161159
// The following block retires already updating nodes
162160
if len(update) > 0 {

test/e2e/node_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ func (k *NodeTests) Run(t *testing.T) {
4747
_ = t.Run("Created", k.StateRunning) &&
4848
t.Run("Tagged", k.Tagged) &&
4949
t.Run("Registered", k.Registered) &&
50-
//t.Run("LatestContainerLinux", k.LatestContainerLinux) &&
50+
t.Run("LatestContainerLinux", k.LatestContainerLinux) &&
5151
t.Run("Schedulable", k.StateSchedulable) &&
5252
t.Run("NetworkUnavailable", k.ConditionNetworkUnavailable) &&
5353
t.Run("Healthy", k.StateHealthy) &&

0 commit comments

Comments
 (0)