plan

package
v0.19.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Dir is default directory for generated files.
	Dir = ".helmwave/"

	// File is default file name for planfile.
	File = "planfile"

	// Body is default file name for main config.
	Body = "helmwave.yml"

	// Manifest is default directory under Dir for manifests.
	Manifest = "manifest/"

	// Values is default directory for values.
	Values = "values/"
)

Variables

View Source
var (
	// ErrPlansAreTheSame is returned when trying to compare plan with itself.
	ErrPlansAreTheSame = errors.New("plan1 and plan2 are the same")

	// SkippedAnnotations is a map with all annotations to be skipped by differ.
	SkippedAnnotations = map[string][]string{
		live.HookAnnotation:               {string(live.HookTest), "test-success", "test-failure"},
		helper.RootAnnoName + "skip-diff": {"true"},
	}
)
View Source
var (
	// FailStatusColor is tablewriter color for failed releases.
	FailStatusColor = tablewriter.Color(tablewriter.Bold, tablewriter.BgRedColor)

	// SuccessStatusColor is tablewriter color for succeeded releases.
	SuccessStatusColor = tablewriter.Color(tablewriter.Bold, tablewriter.BgRedColor)
)
View Source
var (
	// ErrManifestDirNotFound is an error for nonexistent manifest dir.
	ErrManifestDirNotFound = errors.New(Manifest + " dir not found")

	// ErrManifestDirEmpty is an error for empty manifest dir.
	ErrManifestDirEmpty = errors.New(Manifest + " is empty")
)
View Source
var ErrDeploy = errors.New("deploy failed")

ErrDeploy is returned when deploy is failed for whatever reason.

View Source
var ErrValidateFailed = errors.New("validate failed")

ErrValidateFailed is returned for failed values validation.

Functions

func NewBody

func NewBody(file string) (*planBody, error)

func SyncRepositories added in v0.17.0

func SyncRepositories(repositories repo.Configs) error

SyncRepositories initializes helm repository.yaml file with flock and installs provided repositories.

Types

type Plan

type Plan struct {
	// contains filtered or unexported fields
}

Plan contains full helmwave state.

func New

func New(dir string) *Plan

New returns empty *Plan for provided directory.

func NewAndImport added in v0.19.1

func NewAndImport(src string) (p *Plan, err error)

NewAndImport wrapper for New and Import in one.

func (*Plan) Apply

func (p *Plan) Apply() (err error)

Apply syncs repositories and releases.

func (*Plan) ApplyReport

func (p *Plan) ApplyReport(fails map[release.Config]error) error

ApplyReport renders table report for failed releases.

func (*Plan) ApplyWithKubedog

func (p *Plan) ApplyWithKubedog(kubedogConfig *kubedog.Config) (err error)

ApplyWithKubedog runs kubedog in goroutine and syncs repositories and releases.

func (*Plan) Build

func (p *Plan) Build(yml string, tags []string, matchAll bool, templater string) error

Build plan with yml and tags/matchALL options.

func (*Plan) Destroy

func (p *Plan) Destroy() error

Destroy destroys all releases that exist in plan.

func (*Plan) DiffLive added in v0.16.0

func (p *Plan) DiffLive(showSecret bool, diffWide int)

DiffLive show diff with production releases in k8s-cluster.

func (*Plan) DiffPlan added in v0.16.0

func (p *Plan) DiffPlan(b *Plan, showSecret bool, diffWide int)

DiffPlan show diff between 2 plans.

func (*Plan) Export

func (p *Plan) Export() error

Export allows save plan to file.

func (*Plan) GetLive added in v0.16.0

func (p *Plan) GetLive() (found map[uniqname.UniqName]*live.Release, notFound []uniqname.UniqName, err error)

GetLive returns maps of releases in a k8s-cluster.

func (*Plan) GetLiveOf added in v0.16.0

func (p *Plan) GetLiveOf(name uniqname.UniqName) (*live.Release, error)

GetLiveOf returns instance of deployed helm release by name.

func (*Plan) Import

func (p *Plan) Import() error

Import parses directory with plan files and imports them into structure.

func (*Plan) IsExist

func (p *Plan) IsExist() bool

IsExist returns true if planfile exists.

func (*Plan) IsManifestExist

func (p *Plan) IsManifestExist() bool

IsManifestExist returns true if planfile exists.

func (*Plan) List

func (p *Plan) List() error

List renders releases status table and writes it to stdout. Listed only releases that exist in plan.

func (*Plan) Logger added in v0.19.1

func (p *Plan) Logger() *log.Entry

Logger will pretty build log.Entry.

func (*Plan) Rollback

func (p *Plan) Rollback(version int) error

Rollback rollbacks helm release. nolint:nolintlint

func (*Plan) Status

func (p *Plan) Status(names ...string) error

Status renders status table for list of releases names.

func (*Plan) ValidateValues

func (p *Plan) ValidateValues() error

ValidateValues checks whether all values files exist.

Jump to

Keyboard shortcuts

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