store

package
v1.3.6 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2020 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 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