Andrey Smirnov 350280eb59 feat: implement "staged" (failsafe/backup) upgrades
Regular upgrade path takes just one reboot, but it requires all the
processes to be stopped on the node before upgrade might proceed. Under
some circumstances and with potential Talos bugs it might not work
rendering Talos upgrades almost impossible.

Staged upgrades build upon regular install flow to run the upgrade on
the node reboot. Such upgrades require two reboots of the node, and it
requires two pulls of the installer image, but they should be much less
suspicious to the failure. Once the upgrade is staged, node can be
rebooted in any possible way, including hard reset and upgrade is
performed on the next boot.

New ADV format was implemented as well to allow to store install image
ref/options across reboots. New format allows for bigger values and
takes 50% of the `META` partition. Old ADV is still kept for
compatibility reasons.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
2020-12-08 08:34:26 -08:00

38 lines
899 B
Go

// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
package runtime
import (
"github.com/talos-systems/go-blockdevice/blockdevice/probe"
"github.com/talos-systems/talos/pkg/machinery/config"
)
// State defines the state.
type State interface {
Platform() Platform
Machine() MachineState
Cluster() ClusterState
}
// Machine defines the runtime parameters.
type Machine interface {
State() MachineState
Config() config.MachineConfig
}
// MachineState defines the machined state.
type MachineState interface {
Disk() *probe.ProbedBlockDevice
Close() error
Installed() bool
IsInstallStaged() bool
StagedInstallImageRef() string
StagedInstallOptions() []byte
}
// ClusterState defines the cluster state.
type ClusterState interface{}