state

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2018 License: Apache-2.0 Imports: 16 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Empty

type Empty struct{}

func (Empty) CurrentConfig

func (Empty) CurrentConfig() map[string]interface{}

func (Empty) CurrentHelmValues

func (Empty) CurrentHelmValues() string

func (Empty) CurrentHelmValuesDefaults

func (Empty) CurrentHelmValuesDefaults() string

func (Empty) CurrentKustomize

func (Empty) CurrentKustomize() *Kustomize

func (Empty) CurrentKustomizeOverlay

func (Empty) CurrentKustomizeOverlay(string) string

func (Empty) Upstream

func (Empty) Upstream() string

func (Empty) Versioned

func (Empty) Versioned() VersionedState

type Kustomize

type Kustomize struct {
	Overlays map[string]Overlay `json:"overlays,omitempty" yaml:"overlays,omitempty" hcl:"overlays,omitempty"`
}

func (*Kustomize) Ship

func (k *Kustomize) Ship() Overlay

type Lifeycle

type Lifeycle struct {
	StepsCompleted StepsCompleted `json:"stepsCompleted,omitempty" yaml:"stepsCompleted,omitempty" hcl:"stepsCompleted,omitempty"`
}

func (*Lifeycle) WithCompletedStep

func (l *Lifeycle) WithCompletedStep(step api.Step) *Lifeycle

type MManager

type MManager struct {
	Logger  log.Logger
	FS      afero.Afero
	V       *viper.Viper
	Patcher patch.Patcher
}

MManager is the saved output of a plan run to load on future runs

func (*MManager) RemoveStateFile

func (m *MManager) RemoveStateFile() error

RemoveStateFile will attempt to remove the state file from disk

func (*MManager) Save

func (m *MManager) Save(v VersionedState) error

func (*MManager) SaveKustomize

func (m *MManager) SaveKustomize(kustomize *Kustomize) error

func (*MManager) SerializeConfig

func (m *MManager) SerializeConfig(assets []api.Asset, meta api.ReleaseMetadata, templateContext map[string]interface{}) error

SerializeConfig takes the application data and input params and serializes a state file to disk

func (*MManager) SerializeContentSHA

func (m *MManager) SerializeContentSHA(contentSHA string) error

SerializeContentSHA writes the contentSHA to the state file

func (*MManager) SerializeHelmValues

func (m *MManager) SerializeHelmValues(values string, defaults string) error

SerializeHelmValues takes user input helm values and serializes a state file to disk

func (*MManager) SerializeUpstream

func (m *MManager) SerializeUpstream(upstream string) error

SerializeUpstream is used by `ship init` to serialize a state file with ChartURL to disk

func (*MManager) TryLoad

func (m *MManager) TryLoad() (State, error)

TryLoad will attempt to load a state file from disk, if present

type Manager

type Manager interface {
	SerializeHelmValues(values string, defaults string) error
	SerializeConfig(
		assets []api.Asset,
		meta api.ReleaseMetadata,
		templateContext map[string]interface{},
	) error
	TryLoad() (State, error)
	RemoveStateFile() error
	SaveKustomize(kustomize *Kustomize) error
	SerializeUpstream(URL string) error
	SerializeContentSHA(contentSHA string) error
	Save(v VersionedState) error
}

func NewManager

func NewManager(
	logger log.Logger,
	fs afero.Afero,
	v *viper.Viper,
	patcher patch.Patcher,
) Manager

type Overlay

type Overlay struct {
	Patches           map[string]string `json:"patches,omitempty" yaml:"patches,omitempty" hcl:"patches,omitempty"`
	KustomizationYAML string            `json:"kustomization_yaml,omitempty" yaml:"kustomization_yaml,omitempty" hcl:"kustomization_yaml,omitempty"`
}

type State

type State interface {
	CurrentConfig() map[string]interface{}
	CurrentKustomize() *Kustomize
	CurrentKustomizeOverlay(filename string) string
	CurrentHelmValues() string
	CurrentHelmValuesDefaults() string
	Upstream() string
	Versioned() VersionedState
}

now that we have Versioned(), we probably don't need nearly so broad an interface here

type StepsCompleted

type StepsCompleted map[string]interface{}

func (StepsCompleted) String

func (s StepsCompleted) String() string

type V0

type V0 map[string]interface{}

func (V0) CurrentConfig

func (v V0) CurrentConfig() map[string]interface{}

func (V0) CurrentHelmValues

func (v V0) CurrentHelmValues() string

func (V0) CurrentHelmValuesDefaults

func (v V0) CurrentHelmValuesDefaults() string

func (V0) CurrentKustomize

func (v V0) CurrentKustomize() *Kustomize

func (V0) CurrentKustomizeOverlay

func (v V0) CurrentKustomizeOverlay(string) string

func (V0) Upstream

func (v V0) Upstream() string

func (V0) Versioned

func (v V0) Versioned() VersionedState

type V1

type V1 struct {
	Config             map[string]interface{} `json:"config" yaml:"config" hcl:"config"`
	Terraform          interface{}            `json:"terraform,omitempty" yaml:"terraform,omitempty" hcl:"terraform,omitempty"`
	HelmValues         string                 `json:"helmValues,omitempty" yaml:"helmValues,omitempty" hcl:"helmValues,omitempty"`
	HelmValuesDefaults string                 `json:"helmValuesDefaults,omitempty" yaml:"helmValuesDefaults,omitempty" hcl:"helmValuesDefaults,omitempty"`
	Kustomize          *Kustomize             `json:"kustomize,omitempty" yaml:"kustomize,omitempty" hcl:"kustomize,omitempty"`
	Upstream           string                 `json:"upstream,omitempty" yaml:"upstream,omitempty" hcl:"upstream,omitempty"`
	//deprecated in favor of upstream
	ChartURL     string    `json:"chartURL,omitempty" yaml:"chartURL,omitempty" hcl:"chartURL,omitempty"`
	ChartRepoURL string    `json:"ChartRepoURL,omitempty" yaml:"ChartRepoURL,omitempty" hcl:"ChartRepoURL,omitempty"`
	ChartVersion string    `json:"ChartVersion,omitempty" yaml:"ChartVersion,omitempty" hcl:"ChartVersion,omitempty"`
	ContentSHA   string    `json:"contentSHA,omitempty" yaml:"contentSHA,omitempty" hcl:"contentSHA,omitempty"`
	Lifecycle    *Lifeycle `json:"lifecycle,omitempty" yaml:"lifecycle,omitempty" hcl:"lifecycle,omitempty"`
}

type VersionedState

type VersionedState struct {
	V1 *V1 `json:"v1,omitempty" yaml:"v1,omitempty" hcl:"v1,omitempty"`
}

func (VersionedState) CurrentConfig

func (v VersionedState) CurrentConfig() map[string]interface{}

func (VersionedState) CurrentHelmValues

func (v VersionedState) CurrentHelmValues() string

func (VersionedState) CurrentHelmValuesDefaults

func (v VersionedState) CurrentHelmValuesDefaults() string

func (VersionedState) CurrentKustomize

func (v VersionedState) CurrentKustomize() *Kustomize

func (VersionedState) CurrentKustomizeOverlay

func (v VersionedState) CurrentKustomizeOverlay(filename string) string

func (VersionedState) Upstream

func (v VersionedState) Upstream() string

func (VersionedState) Versioned

func (v VersionedState) Versioned() VersionedState

func (VersionedState) WithCompletedStep

func (v VersionedState) WithCompletedStep(step api.Step) VersionedState

Jump to

Keyboard shortcuts

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