store

package
v1.14.6-beta.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2019 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Store

type Store interface {
	// Initialize sets up the storage layer
	Initialize() error

	// Exists returns true if the object referenced by `source` has been checkpointed.
	// The source must be unambiguous - e.g. if referencing an API object it must specify both uid and resourceVersion.
	Exists(source checkpoint.RemoteConfigSource) (bool, error)
	// Save Kubelet config payloads to the storage layer. It must be possible to unmarshal the payload to a KubeletConfiguration.
	// The following payload types are supported:
	// - k8s.io/api/core/v1.ConfigMap
	Save(c checkpoint.Payload) error
	// Load loads the KubeletConfiguration from the checkpoint referenced by `source`.
	Load(source checkpoint.RemoteConfigSource) (*kubeletconfig.KubeletConfiguration, error)

	// AssignedModified returns the last time that the assigned checkpoint was set
	AssignedModified() (time.Time, error)
	// Assigned returns the source that points to the checkpoint currently assigned to the Kubelet, or nil if no assigned checkpoint is set
	Assigned() (checkpoint.RemoteConfigSource, error)
	// LastKnownGood returns the source that points to the last-known-good checkpoint, or nil if no last-known-good checkpoint is set
	LastKnownGood() (checkpoint.RemoteConfigSource, error)

	// SetAssigned saves the source that points to the assigned checkpoint, set to nil to unset
	SetAssigned(source checkpoint.RemoteConfigSource) error
	// SetLastKnownGood saves the source that points to the last-known-good checkpoint, set to nil to unset
	SetLastKnownGood(source checkpoint.RemoteConfigSource) error
	// Reset unsets the assigned and last-known-good checkpoints and returns whether the assigned checkpoint was unset as a result of the reset
	Reset() (bool, error)
}

Store saves checkpoints and information about which is the assigned and last-known-good checkpoint to a storage layer

func NewFakeStore added in v1.11.6

func NewFakeStore() Store

NewFakeStore constructs a fake Store

func NewFsStore

func NewFsStore(fs utilfs.Filesystem, dir string) Store

NewFsStore returns a Store that saves its data in dir

Jump to

Keyboard shortcuts

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