store

package
v1.8.7 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2022 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package store implements persistent store for recording current/past states of the addon rollouts.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AddonRun

type AddonRun struct {
	// Name is a name of an addon associated with the run.
	Name string
	// Modules is map of all modules (each represents a single file)
	// required to run an addon.
	Modules map[string]string

	// Data is opaque data passed in by addon during execution.
	Data map[string][]byte

	// ObjRefs is a slice of object references (could be external to
	// Kubernetes objects) that were part of this run.
	// TODO(dmitry-ilyevskiy): Make this into proper interface definition
	// once the scope of operations is a little bit more defined.
	ObjRefs []interface{}
}

AddonRun represents stored state of an addon run.

type NoopStore added in v1.6.0

type NoopStore struct{}

NoopStore implements Store interface for no-op store. It does not store rollout and addon run information anywhere.

func (NoopStore) CompleteRollout added in v1.6.0

func (NoopStore) CompleteRollout(id RolloutID) error

CompleteRollout is a noop.

func (NoopStore) CreateRollout added in v1.6.0

func (NoopStore) CreateRollout() (*Rollout, error)

CreateRollout only returns a new empty Rollout.

func (NoopStore) GetLive added in v1.6.0

func (NoopStore) GetLive() (r *Rollout, found bool, err error)

GetLive returns a nil Rollout and `false` for `found`.

func (NoopStore) GetRollout added in v1.6.0

func (NoopStore) GetRollout(id RolloutID) (r *Rollout, found bool, err error)

GetRollout returns a nil Rollout and `false` for `found`.

func (NoopStore) PutAddonRun added in v1.6.0

func (NoopStore) PutAddonRun(id RolloutID, _ *AddonRun) (RunID, error)

PutAddonRun is a noop. It returns an empty string RunID.

type Rollout

type Rollout struct {
	ID     RolloutID
	Addons []*AddonRun
	Live   bool
}

Rollout represents a single rollout - a set of addon runs. The last rollout to complete successfully is marked as "live" (there must be at most one "live" rollout).

type RolloutID

type RolloutID string

RolloutID is a unique rollout ID string.

type RunID

type RunID string

RunID is id of an addon run.

type Store

type Store interface {
	// CreateRollout initializes and returns a new *Rollout object with
	// defaults and new RolloutID (committed to the store).
	CreateRollout() (*Rollout, error)

	// PutAddonRun records addon rollout for run id.
	PutAddonRun(id RolloutID, addon *AddonRun) (RunID, error)

	// CompleteRollout marks rollout run as complete (sets it as "live").
	// All further PutAddonRun operations will fail.
	CompleteRollout(id RolloutID) error

	// GetLive returns a single "live" rollout, if found.
	GetLive() (r *Rollout, found bool, err error)

	// GetRollout returns past or live rollout by id.
	GetRollout(id RolloutID) (r *Rollout, found bool, err error)
}

Store defines a rollout store interface.

Directories

Path Synopsis
Package kube implement Kubernetes storage for rollouts.
Package kube implement Kubernetes storage for rollouts.

Jump to

Keyboard shortcuts

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