release

package
v0.12.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2024 License: Apache-2.0 Imports: 6 Imported by: 9

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrEmptyRelease         = errors.New("empty release")
	ErrEmptyProject         = errors.New("empty project")
	ErrEmptyWorkspace       = errors.New("empty workspace")
	ErrEmptyRevision        = errors.New("empty revision")
	ErrEmptyStack           = errors.New("empty stack")
	ErrEmptySpec            = errors.New("empty spec")
	ErrEmptyState           = errors.New("empty state")
	ErrEmptyPhase           = errors.New("empty phase")
	ErrEmptyCreateTime      = errors.New("empty create time")
	ErrEmptyModifiedTime    = errors.New("empty modified time")
	ErrDuplicateResourceKey = errors.New("duplicate resource key")
)

Functions

func CreateDestroyRelease

func CreateDestroyRelease(storage Storage, project, stack, workspace string) (*v1.Release, error)

CreateDestroyRelease creates a release object in the storage for destroy operation.

func GetLatestState

func GetLatestState(storage Storage) (*v1.State, error)

GetLatestState returns the latest state. If no release exists, return nil.

func NewApplyRelease

func NewApplyRelease(storage Storage, project, stack, workspace string) (*v1.Release, error)

NewApplyRelease news a release object for apply operation, but no creation in the storage.

func UpdateApplyRelease

func UpdateApplyRelease(storage Storage, rel *v1.Release, dryRun bool, relLock *sync.Mutex) error

UpdateApplyRelease updates the release in the storage if dryRun is false. If release phase is failed, only logging with no error return.

func UpdateDestroyRelease

func UpdateDestroyRelease(storage Storage, rel *v1.Release) error

UpdateDestroyRelease updates the release in the storage. If release phase is failed, only logging with no error return.

func UpdateReleasePhase

func UpdateReleasePhase(rel *v1.Release, phase v1.ReleasePhase, relLock *sync.Mutex)

UpdateReleasePhase updates the release with the specified phase.

func ValidateRelease

func ValidateRelease(r *v1.Release) error

func ValidateSpec

func ValidateSpec(spec *v1.Spec) error

Types

type Storage

type Storage interface {
	// Get returns a specified Release by Revision.
	Get(revision uint64) (*v1.Release, error)

	// GetRevisions returns all the Revisions.
	GetRevisions() []uint64

	// GetStackBoundRevisions returns the Revisions of a specified Stack.
	GetStackBoundRevisions(stack string) []uint64

	// GetLatestRevision returns the latest State which corresponds to the current infra Resources.
	GetLatestRevision() uint64

	// Create creates a new Release in the Storage.
	Create(release *v1.Release) error

	// Update updates an existing Release in the Storage.
	Update(release *v1.Release) error
}

Storage is used to provide storage service for multiple Releases of a specified Project and Workspace.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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