gitops

package
v0.0.53 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: BSD-3-Clause Imports: 17 Imported by: 0

Documentation

Overview

Package gitops is an implementation of the terra.State interface that reads configuration from terra-helmfile

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStateLoader

func NewStateLoader(thelmaHome string, shellRunner shell.Runner, statebucket statebucket.StateBucket) terra.StateLoader

Types

type LoadOption

type LoadOption func(LoadOptions) LoadOptions

type LoadOptions

type LoadOptions struct {
	StateBucket statebucket.StateBucket
}

type MockSnapshot

type MockSnapshot struct {
	mock.Mock
}

func NewMockSnapshot

func NewMockSnapshot() *MockSnapshot

func (*MockSnapshot) AppVersion

func (s *MockSnapshot) AppVersion(releaseName string) string

func (*MockSnapshot) ChartVersion

func (s *MockSnapshot) ChartVersion(releaseName string) string

func (*MockSnapshot) ReleaseDefined

func (s *MockSnapshot) ReleaseDefined(releaseName string) bool

func (*MockSnapshot) UpdateChartVersionIfDefined

func (s *MockSnapshot) UpdateChartVersionIfDefined(releaseName string, newVersion string) error

type MockVersions

type MockVersions struct {
	mock.Mock
}

func NewMockVersions

func NewMockVersions() *MockVersions

func (*MockVersions) GetSnapshot

func (v *MockVersions) GetSnapshot(releaseType terra.ReleaseType, versionSet VersionSet) VersionSnapshot

type VersionSet

type VersionSet int

VersionSet is an enum type representing a version set defined in terra-helmfile

const (
	Dev VersionSet = iota
	Alpha
	Staging
	Prod
)

func VersionSets

func VersionSets() []VersionSet

func (VersionSet) String

func (s VersionSet) String() string

type VersionSnapshot

type VersionSnapshot interface {
	// ReleaseDefined returns true if the given release is defined in this snapshot
	ReleaseDefined(releaseName string) bool
	// ChartVersion returns the chartVersion for the given release in this snapshot. If the release is not defined, returns ""
	ChartVersion(releaseName string) string
	// AppVersion returns the chartVersion for the given release in this snapshot. If the release is not defined, returns ""
	AppVersion(releaseName string) string
	// UpdateChartVersionIfDefined sets the chartVersion for the given release to the given version.
	// If the release is not defined, or if newVersion <= the current chart version, this function does nothing.
	UpdateChartVersionIfDefined(releaseName string, newVersion string) error
}

type Versions

type Versions interface {
	// GetSnapshot returns a VersionSnapshot reference for the given release type & version set
	GetSnapshot(releaseType terra.ReleaseType, versionSet VersionSet) VersionSnapshot
}

Versions is for manipulating chart release versions in terra-helmfile (eg. versions/app/dev.yaml, versions/cluster/dev.yaml)

func NewVersions

func NewVersions(thelmaHome string, shellRunner shell.Runner) (Versions, error)

NewVersions returns a new Versions instance

Directories

Path Synopsis
Package statefixtures provides a fake state provider for use in unit tests
Package statefixtures provides a fake state provider for use in unit tests

Jump to

Keyboard shortcuts

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