workflow

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ClientNotConfiguredErr = errors.New("manager client not configured")

Functions

This section is empty.

Types

type Manager

type Manager interface {
	// Managed returns all Kubernetes objects managed by the Manager.
	// It is safe to call this method on non-initialized Manager.
	Managed() []client.Object

	// Execute executes the overall workflow. It will interact with Kubernetes API,
	// so make sure to use WithClient before execution.
	// If the client is not set, it returns ClientNotConfiguredErr error.
	Execute(ctx context.Context, plant *apiv1.Plant) ([]resource.ExecuteResult, error)

	// Client returns the current Manager Kubernetes client
	Client() client.Client

	// WithClient sets the current Manager Client. Must be called before Run.
	WithClient(client client.Client) Manager
}

Manager runs required workflow without modifying the Plant object. It abstracts the operator execution from configuration and simplifies the overall dependency management. TODO: Tests can use mocked Manager interface

func NewManager

func NewManager() Manager

NewManager creates a bare Manager. Before executing Manager.Run, make sure to configure client via Manager.WithClient

Jump to

Keyboard shortcuts

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