Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { SnapstoreConfig *snapstore.Config RestoreOptions *restorer.RestoreOptions }
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(options *restorer.RestoreOptions, snapstoreConfig *snapstore.Config, logger *logrus.Logger) *EtcdInitializer
NewInitializer creates an etcd initializer object.
func (*EtcdInitializer) Initialize ¶
func (e *EtcdInitializer) Initialize(mode validator.Mode) 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.
type Initializer ¶
Initializer is the interface for etcd initialization actions.
Click to show internal directories.
Click to hide internal directories.