release

package
v1.21.1-0...-8239ed6 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyChanges

func ApplyChanges(ctx context.Context, rc *ReleaseContext, updates []*update.WorkloadUpdate, logger log.Logger) error

func MakeReleaseError

func MakeReleaseError(err error) *fluxerr.Error

func Release

func Release(ctx context.Context, rc *ReleaseContext, changes Changes, logger log.Logger) (results update.Result, err error)

func VerifyChanges

func VerifyChanges(before map[string]resource.Resource, updates []*update.WorkloadUpdate, after map[string]resource.Resource) error

VerifyChanges checks that the `after` resources are exactly the `before` resources with the updates applied. It destructively updates `before`.

Types

type Changes

type Changes interface {
	CalculateRelease(context.Context, update.ReleaseContext, log.Logger) ([]*update.WorkloadUpdate, update.Result, error)
	ReleaseKind() update.ReleaseKind
	ReleaseType() update.ReleaseType
	CommitMessage(update.Result) string
}

type ReleaseContext

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

func NewReleaseContext

func NewReleaseContext(cluster cluster.Cluster, resourceStore manifests.Store, registry registry.Registry) *ReleaseContext

func (*ReleaseContext) GetAllResources

func (rc *ReleaseContext) GetAllResources(ctx context.Context) (map[string]resource.Resource, error)

func (*ReleaseContext) Registry

func (rc *ReleaseContext) Registry() registry.Registry

func (*ReleaseContext) SelectWorkloads

func (rc *ReleaseContext) SelectWorkloads(ctx context.Context, results update.Result, prefilters,
	postfilters []update.WorkloadFilter) ([]*update.WorkloadUpdate, error)

SelectWorkloads finds the workloads that exist both in the definition files and the running cluster. `WorkloadFilter`s can be provided to filter the controllers so found, either before (`prefilters`) or after (`postfilters`) consulting the cluster.

func (*ReleaseContext) WorkloadsForUpdate

func (rc *ReleaseContext) WorkloadsForUpdate(ctx context.Context) (map[resource.ID]*update.WorkloadUpdate, error)

WorkloadsForUpdate collects all workloads defined in manifests and prepares a list of workload updates for each of them. It does not consider updatability.

func (*ReleaseContext) WriteUpdates

func (rc *ReleaseContext) WriteUpdates(ctx context.Context, updates []*update.WorkloadUpdate) error

Jump to

Keyboard shortcuts

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