solver

package
v0.26.0 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2021 License: Apache-2.0 Imports: 17 Imported by: 1

Documentation

Overview

The solver package is responsible for constructing a taskqueue based on the set of resources that should be applied. This involves setting up the appropriate sequence of apply, wait and prune tasks so any dependencies between resources doesn't cause a later apply operation to fail. Currently this package assumes that the resources have already been sorted in the appropriate order. We might want to consider moving the sorting functionality into this package.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Options

type Options struct {
	ServerSideOptions      common.ServerSideOptions
	ReconcileTimeout       time.Duration
	Prune                  bool
	DryRunStrategy         common.DryRunStrategy
	PrunePropagationPolicy metav1.DeletionPropagation
	PruneTimeout           time.Duration
	InventoryPolicy        inventory.InventoryPolicy
}

type TaskQueue added in v0.26.0

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

func (*TaskQueue) ToActionGroups added in v0.26.0

func (tq *TaskQueue) ToActionGroups() []event.ActionGroup

func (*TaskQueue) ToChannel added in v0.26.0

func (tq *TaskQueue) ToChannel() chan taskrunner.Task

type TaskQueueBuilder added in v0.26.0

type TaskQueueBuilder struct {
	PruneOptions *prune.PruneOptions
	InfoHelper   info.InfoHelper
	Factory      util.Factory
	Mapper       meta.RESTMapper
	InvClient    inventory.InventoryClient
	// True if we are destroying, which deletes the inventory object
	// as well (possibly) the inventory namespace.
	Destroy bool
	// contains filtered or unexported fields
}

func (*TaskQueueBuilder) AppendApplyTask added in v0.26.0

func (t *TaskQueueBuilder) AppendApplyTask(applyObjs object.UnstructuredSet,
	applyFilters []filter.ValidationFilter, applyMutators []mutator.Interface, o Options) *TaskQueueBuilder

AppendInvAddTask appends a task to the task queue to apply the passed objects to the cluster. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendApplyWaitTasks added in v0.26.0

func (t *TaskQueueBuilder) AppendApplyWaitTasks(applyObjs object.UnstructuredSet,
	applyFilters []filter.ValidationFilter, applyMutators []mutator.Interface, o Options) *TaskQueueBuilder

AppendApplyWaitTasks adds apply and wait tasks to the task queue, depending on build variables (like dry-run) and resource types (like CRD's). Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendDeleteInvTask added in v0.26.0

func (t *TaskQueueBuilder) AppendDeleteInvTask(inv inventory.InventoryInfo, dryRun common.DryRunStrategy) *TaskQueueBuilder

AppendInvAddTask appends to the task queue a task to delete the inventory object. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendInvAddTask added in v0.26.0

AppendInvAddTask appends an inventory add task to the task queue. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendInvSetTask added in v0.26.0

AppendInvAddTask appends an inventory set task to the task queue. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendPruneTask added in v0.26.0

func (t *TaskQueueBuilder) AppendPruneTask(pruneObjs object.UnstructuredSet,
	pruneFilters []filter.ValidationFilter, o Options) *TaskQueueBuilder

AppendInvAddTask appends a task to delete objects from the cluster to the task queue. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendPruneWaitTasks added in v0.26.0

func (t *TaskQueueBuilder) AppendPruneWaitTasks(pruneObjs object.UnstructuredSet,
	pruneFilters []filter.ValidationFilter, o Options) *TaskQueueBuilder

AppendPruneWaitTasks adds prune and wait tasks to the task queue based on build variables (like dry-run). Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) AppendWaitTask added in v0.26.0

func (t *TaskQueueBuilder) AppendWaitTask(waitIds object.ObjMetadataSet, condition taskrunner.Condition,
	waitTimeout time.Duration) *TaskQueueBuilder

AppendInvAddTask appends a task to wait on the passed objects to the task queue. Returns a pointer to the Builder to chain function calls.

func (*TaskQueueBuilder) Build added in v0.26.0

func (t *TaskQueueBuilder) Build() (*TaskQueue, error)

Build returns the queue of tasks that have been created. TODO(seans): Now that we're reporting errors, we probably want to move away from the Builder patter for the TaskBuilder.

Jump to

Keyboard shortcuts

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