statebucket

package
v0.0.35 Latest Latest
Warning

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

Go to latest
Published: May 11, 2022 License: BSD-3-Clause Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicEnvironment

type DynamicEnvironment struct {
	Name      string               `json:"name"`
	Template  string               `json:"template"`
	Overrides map[string]*Override `json:"overrides"`
	Hybrid    bool                 `json:"hybrid"` // Deprecated / temporary (while we run bees in hybrid mode)
	Fiab      Fiab                 `json:"fiab"`   // Deprecated / temporary (while we run bees in hybrid mode)
}

DynamicEnvironment is a struct representing a dynamic environment in the state file

func (DynamicEnvironment) MarshalJSON added in v0.0.35

func (e DynamicEnvironment) MarshalJSON() ([]byte, error)

func (*DynamicEnvironment) UnmarshalJSON added in v0.0.35

func (e *DynamicEnvironment) UnmarshalJSON(data []byte) error

type Fiab

type Fiab struct {
	IP   string `json:"ip"`
	Name string `json:"name"`
}

Fiab (DEPRECATED) is a struct for representing a Fiab in the state file

type Override added in v0.0.35

type Override struct {
	Enabled  *bool                 `json:"enabled,omitempty" yaml:",omitempty"`
	Versions terra.VersionOverride `json:"versions,omitempty" yaml:",omitempty"`
}

Override represents configuration overrides for a release in an environment

func (*Override) Disable added in v0.0.35

func (o *Override) Disable()

func (*Override) Enable added in v0.0.35

func (o *Override) Enable()

func (*Override) HasEnableOverride added in v0.0.35

func (o *Override) HasEnableOverride() bool

func (*Override) IsEnabled added in v0.0.35

func (o *Override) IsEnabled() bool

func (*Override) PinVersions added in v0.0.35

func (o *Override) PinVersions(versions terra.VersionOverride)

PinVersions applies the given VersionOverride to this override, ignoring empty fields in the parameter

func (*Override) UnpinVersions added in v0.0.35

func (o *Override) UnpinVersions()

UnpinVersions removes all version overrides

type StateBucket

type StateBucket interface {
	// Environments returns the list of all environments in the state file
	Environments() ([]DynamicEnvironment, error)
	// Add adds a new environment to the state file
	Add(environment DynamicEnvironment) error
	// EnableRelease enables the given release in the target environment
	EnableRelease(environmentName string, releaseName string) error
	// DisableRelease disables the given release in the target environment
	DisableRelease(environmentName string, releaseName string) error
	// PinVersions can be used to update the environment's map of version overrides
	PinVersions(environmentName string, versions map[string]terra.VersionOverride) error
	// UnpinVersions can be used to remove the environment's map of version overrides
	UnpinVersions(environmentName string) error
	// Delete will delete an environment from the state file
	Delete(environmentName string) error
	// contains filtered or unexported methods
}

StateBucket is for tracking state for dynamic environments. (Stored in a GCS bucket)

func New

func New(thelmaConfig config.Config, googleClients google.Clients) (StateBucket, error)

New returns a new statebucket

func NewFake

func NewFake(dir string) (StateBucket, error)

NewFake (FOR USE IN TESTS ONLY) returns a new fake statebucket, backed by local filesystem instead of a GCS bucket

type StateFile

type StateFile struct {
	SchemaVersion int32
	Environments  map[string]DynamicEnvironment `json:"environments"`
}

StateFile represents the structure of the statefile

Jump to

Keyboard shortcuts

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