plan

package
v0.20.2 Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2022 License: Apache-2.0 Imports: 19 Imported by: 0

README

It's not good to assume that resources exist. It's possible for a particular cluster to be offline for a period of time and miss certain updates. Try to use controllerutil.CreateOrUpdate for all resources you are changing and to have them completely filled out. Simple edits are not supported.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoChangeNeeded = NoChangeNeededError(errors.New("no change needed"))

Functions

func CopyStringMap

func CopyStringMap(src map[string]string) map[string]string

func CreateOrUpdate

func CreateOrUpdate(
	ctx context.Context,
	log logr.Logger,
	cli client.Client,
	obj runtime.Object,
) error

CreateOrUpdate safely performs a standard CreateOrUpdate for known types. my kingdom for go generics

func LogSync

func LogSync(log logr.Logger, op controllerutil.OperationResult, err error, resource runtime.Object)

Types

type Applier

type Applier interface {
	Apply(context.Context, Plan) error
}

func NewClusterApplier

func NewClusterApplier(cli client.Client, cluster *picchuv1alpha1.Cluster, log logr.Logger) Applier

func NewConcurrentApplier

func NewConcurrentApplier(appliers []Applier, log logr.Logger) Applier

type ClusterApplier

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

func (*ClusterApplier) Apply

func (a *ClusterApplier) Apply(ctx context.Context, plan Plan) error

type ConcurrentApplier

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

func (*ConcurrentApplier) Apply

func (a *ConcurrentApplier) Apply(ctx context.Context, plan Plan) error

type NoChangeNeededError

type NoChangeNeededError error

type Plan

type Plan interface {
	Apply(ctx context.Context, cli client.Client, cluster *picchuv1alpha1.Cluster, log logr.Logger) error
}

func All

func All(plans ...Plan) Plan

type PrintablePlan

type PrintablePlan interface {
	Printable() interface{}
}

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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