task

package
v0.23.5 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ApplyTask

type ApplyTask struct {
	Factory    util.Factory
	InfoHelper info.InfoHelper
	Mapper     meta.RESTMapper
	Objects    []*unstructured.Unstructured
	CRDs       []*unstructured.Unstructured
	// Used for determining inventory during errors
	PrevInventory     map[object.ObjMetadata]bool
	DryRunStrategy    common.DryRunStrategy
	ServerSideOptions common.ServerSideOptions
	InventoryPolicy   inventory.InventoryPolicy
	InvInfo           inventory.InventoryInfo
}

ApplyTask applies the given Objects to the cluster by using the ApplyOptions.

func (*ApplyTask) ClearTimeout

func (a *ApplyTask) ClearTimeout()

ClearTimeout is not supported by the ApplyTask.

func (*ApplyTask) Start

func (a *ApplyTask) Start(taskContext *taskrunner.TaskContext)

Start creates a new goroutine that will invoke the Run function on the ApplyOptions to update the cluster. It will push a TaskResult on the taskChannel to signal to the taskrunner that the task has completed (or failed). It will also fetch the Generation from each of the applied resources after the Run function has completed. This information is then added to the taskContext. The generation is increased every time the desired state of a resource is changed.

type KubectlPrinterAdapter added in v0.14.0

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

KubectlPrinterAdapter is a workaround for capturing progress from ApplyOptions. ApplyOptions were originally meant to print progress directly using a configurable printer. The KubectlPrinterAdapter plugs into ApplyOptions as a ToPrinter function, but instead of printing the info, it emits it as an event on the provided channel.

type PruneTask

type PruneTask struct {
	PruneOptions      *prune.PruneOptions
	InventoryObject   inventory.InventoryInfo
	Objects           []*unstructured.Unstructured
	DryRunStrategy    common.DryRunStrategy
	PropagationPolicy metav1.DeletionPropagation
	InventoryPolicy   inventory.InventoryPolicy
}

PruneTask prunes objects from the cluster by using the PruneOptions. The provided Objects is the set of resources that have just been applied.

func (*PruneTask) ClearTimeout

func (p *PruneTask) ClearTimeout()

ClearTimeout is not supported by the PruneTask.

func (*PruneTask) Start

func (p *PruneTask) Start(taskContext *taskrunner.TaskContext)

Start creates a new goroutine that will invoke the Run function on the PruneOptions to update the cluster. It will push a TaskResult on the taskChannel to signal to the taskrunner that the task has completed (or failed).

type ResetRESTMapperTask added in v0.15.0

type ResetRESTMapperTask struct {
	Mapper meta.RESTMapper
}

ResetRESTMapperTask resets the provided RESTMapper.

func (*ResetRESTMapperTask) ClearTimeout added in v0.15.0

func (r *ResetRESTMapperTask) ClearTimeout()

ClearTimeout doesn't do anything as ResetRESTMapperTask doesn't support timeouts.

func (*ResetRESTMapperTask) Start added in v0.15.0

func (r *ResetRESTMapperTask) Start(taskContext *taskrunner.TaskContext)

Start creates a new goroutine that will unwrap the provided RESTMapper to get the underlying DeferredDiscoveryRESTMapper and then reset it. It will send a TaskResult on the taskChannel to signal that the task has been completed.

type SendEventTask

type SendEventTask struct {
	Event event.Event
}

SendEventTask is an implementation of the Task interface that will send the provided event on the eventChannel when executed.

func (*SendEventTask) ClearTimeout

func (s *SendEventTask) ClearTimeout()

ClearTimeout doesn't do anything as SendEventTask doesn't support timeouts.

func (*SendEventTask) Start

func (s *SendEventTask) Start(taskContext *taskrunner.TaskContext)

Start start a separate goroutine that will send the event and then push a TaskResult on the taskChannel to signal to the taskrunner that the task is completed.

Jump to

Keyboard shortcuts

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