mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-05-22 16:01:17 -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
|
@ -60,6 +60,11 @@ func (c *DiskEncryption) UpdatePassphrase(passphrase string) error {
|
|||
return c.device.SetConstellationStateDiskToken(cryptsetup.SetDiskInitialized)
|
||||
}
|
||||
|
||||
// MarkDiskForReset marks the state disk as not initialized so it may be wiped (reset) on reboot.
|
||||
func (c *DiskEncryption) MarkDiskForReset() error {
|
||||
return c.device.SetConstellationStateDiskToken(cryptsetup.SetDiskNotInitialized)
|
||||
}
|
||||
|
||||
// getInitialPassphrase retrieves the initial passphrase used on first boot.
|
||||
func (c *DiskEncryption) getInitialPassphrase() (string, error) {
|
||||
passphrase, err := afero.ReadFile(c.fs, initialKeyPath)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue