apply

package
v0.36.0-flux.3 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier

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

Applier performs the step of applying a set of resources into a cluster, conditionally waits for all of them to be fully reconciled and finally performs prune to clean up any resources that has been deleted. The applier performs its function by executing a list queue of tasks, each of which is one of the steps in the process of applying a set of resources to the cluster. The actual execution of these tasks are handled by a StatusRunner. So the taskqueue is effectively a specification that is executed by the StatusRunner. Based on input parameters and/or the set of resources that needs to be applied to the cluster, different sets of tasks might be needed.

func (*Applier) Run

func (a *Applier) Run(ctx context.Context, invInfo inventory.Info, objects object.UnstructuredSet, options ApplierOptions) <-chan event.Event

Run performs the Apply step. This happens asynchronously with updates on progress and any errors reported back on the event channel. Cancelling the operation or setting timeout on how long to Wait for it complete can be done with the passed in context. Note: There isn't currently any way to interrupt the operation before all the given resources have been applied to the cluster. Any cancellation or timeout will only affect how long we Wait for the resources to become current.

type ApplierBuilder

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

func NewApplierBuilder

func NewApplierBuilder() *ApplierBuilder

NewApplierBuilder returns a new ApplierBuilder.

func (*ApplierBuilder) Build

func (b *ApplierBuilder) Build() (*Applier, error)

func (*ApplierBuilder) WithDiscoveryClient

func (b *ApplierBuilder) WithDiscoveryClient(discoClient discovery.CachedDiscoveryInterface) *ApplierBuilder

func (*ApplierBuilder) WithDynamicClient

func (b *ApplierBuilder) WithDynamicClient(client dynamic.Interface) *ApplierBuilder

func (*ApplierBuilder) WithFactory

func (b *ApplierBuilder) WithFactory(factory util.Factory) *ApplierBuilder

func (*ApplierBuilder) WithInventoryClient

func (b *ApplierBuilder) WithInventoryClient(invClient inventory.Client) *ApplierBuilder

func (*ApplierBuilder) WithRestConfig

func (b *ApplierBuilder) WithRestConfig(restConfig *rest.Config) *ApplierBuilder

func (*ApplierBuilder) WithRestMapper

func (b *ApplierBuilder) WithRestMapper(mapper meta.RESTMapper) *ApplierBuilder

func (*ApplierBuilder) WithStatusWatcher

func (b *ApplierBuilder) WithStatusWatcher(statusWatcher watcher.StatusWatcher) *ApplierBuilder

func (*ApplierBuilder) WithUnstructuredClientForMapping

func (b *ApplierBuilder) WithUnstructuredClientForMapping(unstructuredClientForMapping func(*meta.RESTMapping) (resource.RESTClient, error)) *ApplierBuilder

type ApplierOptions

type ApplierOptions struct {
	// Encapsulates the fields for server-side apply.
	ServerSideOptions common.ServerSideOptions

	// ReconcileTimeout defines whether the applier should wait
	// until all applied resources have been reconciled, and if so,
	// how long to wait.
	ReconcileTimeout time.Duration

	// EmitStatusEvents defines whether status events should be
	// emitted on the eventChannel to the caller.
	EmitStatusEvents bool

	// NoPrune defines whether pruning of previously applied
	// objects should happen after apply.
	NoPrune bool

	// DryRunStrategy defines whether changes should actually be performed,
	// or if it is just talk and no action.
	DryRunStrategy common.DryRunStrategy

	// PrunePropagationPolicy defines the deletion propagation policy
	// that should be used for pruning. If this is not provided, the
	// default is to use the Background policy.
	PrunePropagationPolicy metav1.DeletionPropagation

	// PruneTimeout defines whether we should wait for all resources
	// to be fully deleted after pruning, and if so, how long we should
	// wait.
	PruneTimeout time.Duration

	// InventoryPolicy defines the inventory policy of apply.
	InventoryPolicy inventory.Policy

	// ValidationPolicy defines how to handle invalid objects.
	ValidationPolicy validation.Policy

	// RESTScopeStrategy specifies which strategy to use when listing and
	// watching resources. By default, the strategy is selected automatically.
	WatcherRESTScopeStrategy watcher.RESTScopeStrategy
}

type Destroyer

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

Destroyer performs the step of grabbing all the previous inventory objects and prune them. This also deletes all the previous inventory objects

func (*Destroyer) Run

func (d *Destroyer) Run(ctx context.Context, invInfo inventory.Info, options DestroyerOptions) <-chan event.Event

Run performs the destroy step. Passes the inventory object. This happens asynchronously on progress and any errors are reported back on the event channel.

type DestroyerBuilder

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

func NewDestroyerBuilder

func NewDestroyerBuilder() *DestroyerBuilder

NewDestroyerBuilder returns a new DestroyerBuilder.

func (*DestroyerBuilder) Build

func (b *DestroyerBuilder) Build() (*Destroyer, error)

func (*DestroyerBuilder) WithDiscoveryClient

func (b *DestroyerBuilder) WithDiscoveryClient(discoClient discovery.CachedDiscoveryInterface) *DestroyerBuilder

func (*DestroyerBuilder) WithDynamicClient

func (b *DestroyerBuilder) WithDynamicClient(client dynamic.Interface) *DestroyerBuilder

func (*DestroyerBuilder) WithFactory

func (b *DestroyerBuilder) WithFactory(factory util.Factory) *DestroyerBuilder

func (*DestroyerBuilder) WithInventoryClient

func (b *DestroyerBuilder) WithInventoryClient(invClient inventory.Client) *DestroyerBuilder

func (*DestroyerBuilder) WithRestConfig

func (b *DestroyerBuilder) WithRestConfig(restConfig *rest.Config) *DestroyerBuilder

func (*DestroyerBuilder) WithRestMapper

func (b *DestroyerBuilder) WithRestMapper(mapper meta.RESTMapper) *DestroyerBuilder

func (*DestroyerBuilder) WithStatusWatcher

func (b *DestroyerBuilder) WithStatusWatcher(statusWatcher watcher.StatusWatcher) *DestroyerBuilder

func (*DestroyerBuilder) WithUnstructuredClientForMapping

func (b *DestroyerBuilder) WithUnstructuredClientForMapping(unstructuredClientForMapping func(*meta.RESTMapping) (resource.RESTClient, error)) *DestroyerBuilder

type DestroyerOptions

type DestroyerOptions struct {
	// InventoryPolicy defines the inventory policy of apply.
	InventoryPolicy inventory.Policy

	// DryRunStrategy defines whether changes should actually be performed,
	// or if it is just talk and no action.
	DryRunStrategy common.DryRunStrategy

	// DeleteTimeout defines how long we should wait for resources
	// to be fully deleted.
	DeleteTimeout time.Duration

	// DeletePropagationPolicy defines the deletion propagation policy
	// that should be used. If this is not provided, the default is to
	// use the Background policy.
	DeletePropagationPolicy metav1.DeletionPropagation

	// EmitStatusEvents defines whether status events should be
	// emitted on the eventChannel to the caller.
	EmitStatusEvents bool

	// ValidationPolicy defines how to handle invalid objects.
	ValidationPolicy validation.Policy
}

Directories

Path Synopsis
The solver package is responsible for constructing a taskqueue based on the set of resources that should be applied.
The solver package is responsible for constructing a taskqueue based on the set of resources that should be applied.

Jump to

Keyboard shortcuts

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