plan

package
v0.29.1 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: MIT Imports: 47 Imported by: 0

Documentation

Index

Constants

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

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

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

	// Manifest is the 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.
	//nolintlint:gochecknoglobals // can't make this const
	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 GenSchema added in v0.23.0

func GenSchema() *jsonschema.Schema

func NewBody

func NewBody(ctx context.Context, file string) (*planBody, error)

NewBody parses plan from file.

func SyncRepositories added in v0.17.0

func SyncRepositories(ctx context.Context, repositories repo.Configs) error

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

Types

type BuildOptions added in v0.27.1

type BuildOptions struct {
	Tags       []string
	Yml        string
	Templater  string
	MatchAll   bool
	GraphWidth int
}

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(ctx context.Context, src string) (p *Plan, err error)

NewAndImport wrapper for New and Import in one.

func (*Plan) ApplyReport

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

ApplyReport renders a table report for failed releases.

func (*Plan) Build

func (p *Plan) Build(ctx context.Context, o BuildOptions) error

Build plan with yml and tags/matchALL options.

func (*Plan) BuildGraphASCII added in v0.27.2

func (p *Plan) BuildGraphASCII(width int) string

func (*Plan) DiffLive added in v0.16.0

func (p *Plan) DiffLive(ctx context.Context, showSecret bool, diffWide int, threeWayMerge bool)

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) Down added in v0.28.0

func (p *Plan) Down(ctx context.Context) error

Down destroys all releases that exist in a plan.

func (*Plan) Export

func (p *Plan) Export(ctx context.Context, skipUnchanged bool) error

Export allows save plan to file.

func (*Plan) GetLive added in v0.16.0

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

GetLive returns maps of releases in a k8s-cluster.

func (*Plan) Import

func (p *Plan) Import(ctx context.Context) 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(ctx context.Context, version int) error

Rollback rollbacks helm release.

func (*Plan) Status

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

Status renders status table for list of releases names.

func (*Plan) Up added in v0.28.0

func (p *Plan) Up(ctx context.Context, dog *kubedog.Config) error

Up syncs repositories and releases.

func (*Plan) ValidateValuesBuild added in v0.20.2

func (p *Plan) ValidateValuesBuild() error

ValidateValuesBuild Dst now is a public method. Dst needs to marshal for export. Also, dst needs to unmarshal for import from plan.

func (*Plan) ValidateValuesImport added in v0.20.2

func (p *Plan) ValidateValuesImport() error

ValidateValuesImport checks whether all values files exist.

Jump to

Keyboard shortcuts

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