initializer

package
v0.6.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 12, 2019 License: Apache-2.0, MIT Imports: 11 Imported by: 0

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

type Initializer interface {
	Initialize(validator.Mode) error
}

Initializer is the interface for etcd initialization actions.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL