Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SnapstoreConfig *brtypes.SnapstoreConfig RestoreOptions *brtypes.RestoreOptions EtcdConnectionConfig *brtypes.EtcdConnectionConfig }
Config holds etcd related configuration required for initialization checks and snapshot restoration in case of corruption.
type EtcdInitializer ¶
type EtcdInitializer struct { Validator *validator.DataValidator Config *Config Logger *logrus.Logger }
EtcdInitializer implements Initializer interface to perform validation and data restore if required.
func NewInitializer ¶
func NewInitializer(restoreOptions *brtypes.RestoreOptions, snapstoreConfig *brtypes.SnapstoreConfig, etcdConnectionConfig *brtypes.EtcdConnectionConfig, logger *logrus.Logger) (*EtcdInitializer, error)
NewInitializer creates an etcd initializer object.
func (*EtcdInitializer) Initialize ¶
func (e *EtcdInitializer) Initialize(mode validator.Mode, failBelowRevision int64) error
Initialize has the following steps:
- Check if data directory exists.
- If data directory exists
- Check for data corruption.
- If data directory is in corrupted state, clear the data directory.
- If data directory does not exist.
- Check if Latest snapshot available.
- Try to perform an Etcd data restoration from the latest snapshot.
- No snapshots are available, start etcd as a fresh installation.
Click to show internal directories.
Click to hide internal directories.