mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-30 11:34:26 -04:00
bootstrapper: wipe disk and reboot on non-recoverable error (#2971)
* Let JoinClient return fatal errors * Mark disk for wiping if JoinClient or InitServer return errors * Reboot system if bootstrapper detects an error * Refactor joinClient start/stop implementation * Fix joining nodes retrying kubeadm 3 times in all cases * Write non-recoverable failures to syslog before rebooting --------- Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
1b973bf23f
commit
1077b7a48e
10 changed files with 199 additions and 220 deletions
|
@ -67,7 +67,10 @@ func TestNew(t *testing.T) {
|
|||
t.Run(name, func(t *testing.T) {
|
||||
assert := assert.New(t)
|
||||
|
||||
server, err := New(context.TODO(), newFakeLock(), &stubClusterInitializer{}, atls.NewFakeIssuer(variant.Dummy{}), fh, &tc.metadata, logger.NewTest(t))
|
||||
server, err := New(
|
||||
context.TODO(), newFakeLock(), &stubClusterInitializer{}, atls.NewFakeIssuer(variant.Dummy{}),
|
||||
&stubDisk{}, fh, &tc.metadata, logger.NewTest(t),
|
||||
)
|
||||
if tc.wantErr {
|
||||
assert.Error(err)
|
||||
return
|
||||
|
@ -381,6 +384,10 @@ func (d *fakeDisk) UpdatePassphrase(passphrase string) error {
|
|||
return nil
|
||||
}
|
||||
|
||||
func (d *fakeDisk) MarkDiskForReset() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type stubDisk struct {
|
||||
openErr error
|
||||
uuid string
|
||||
|
@ -402,6 +409,10 @@ func (d *stubDisk) UpdatePassphrase(string) error {
|
|||
return d.updatePassphraseErr
|
||||
}
|
||||
|
||||
func (d *stubDisk) MarkDiskForReset() error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type stubClusterInitializer struct {
|
||||
initClusterKubeconfig []byte
|
||||
initClusterErr error
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue