await

package
v3.0.0-...-3d101a0 Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2023 License: Apache-2.0 Imports: 49 Imported by: 1

Documentation

Overview

nolint: goconst

Index

Constants

View Source
const (
	DefaultDeploymentTimeoutMins = 10
)
View Source
const (
	DefaultIngressTimeoutMins = 10
)
View Source
const (
	DefaultJobTimeoutMins = 10
)
View Source
const (
	DefaultPodTimeoutMins = 10
)
View Source
const (
	DefaultServiceTimeoutMins = 10
)
View Source
const (
	DefaultStatefulSetTimeoutMins = 10
)

Variables

This section is empty.

Functions

func Creation

Creation (as the usage, `await.Creation`, implies) will block until one of the following is true: (1) the Kubernetes resource is reported to be initialized; (2) the initialization timeout has occurred; or (3) an error has occurred while the resource was being initialized.

func Deletion

func Deletion(c DeleteConfig) error

Deletion (as the usage, `await.Deletion`, implies) will block until one of the following is true: (1) the Kubernetes resource is reported to be deleted; (2) the initialization timeout has occurred; or (3) an error has occurred while the resource was being deleted.

func IsDeleteRequiredFieldErr

func IsDeleteRequiredFieldErr(err error) bool

IsDeleteRequiredFieldErr is true if the user attempted to delete a Patch resource that was the sole manager of a required field.

func IsNamespaceNotFoundErr

func IsNamespaceNotFoundErr(err error) bool

IsNamespaceNotFoundErr returns true if the namespace wasn't found for a k8s client operation.

func IsResourceExistsErr

func IsResourceExistsErr(err error) bool

IsResourceExistsErr returns true if the resource already exists on the k8s cluster.

func Read

Read checks a resource, returning the object if it was created and initialized successfully.

func Update

Update takes `lastSubmitted` (the last version of a Kubernetes API object submitted to the API server) and `currentSubmitted` (the version of the Kubernetes API object being submitted for an update currently) and blocks until one of the following is true: (1) the Kubernetes resource is reported to be updated; (2) the update timeout has occurred; or (3) an error has occurred while the resource was being updated.

Update updates an existing resource with new values. Currently, this client supports the Kubernetes-standard three-way JSON patch, and the newer Server-side Apply patch. See references [1], [2], [3].

nolint [1]: https://kubernetes.io/docs/tasks/run-application/update-api-object-kubectl-patch/#use-a-json-merge-patch-to-update-a-deployment [2]: https://kubernetes.io/docs/concepts/overview/object-management-kubectl/declarative-config/#how-apply-calculates-differences-and-merges-changes [3]: https://kubernetes.io/docs/reference/using-api/server-side-apply

Types

type AggregatedError

type AggregatedError interface {
	SubErrors() []string
}

AggregatedError represents an error with 0 or more sub-errors.

type CreateConfig

type CreateConfig struct {
	ProviderConfig
	Inputs  *unstructured.Unstructured
	Timeout float64
	Preview bool
}

type DeleteConfig

type DeleteConfig struct {
	ProviderConfig
	Inputs  *unstructured.Unstructured
	Name    string
	Timeout float64
}

type PartialError

type PartialError interface {
	Object() *unstructured.Unstructured
}

PartialError represents an object that failed to complete its current operation.

type PodAggregator

type PodAggregator struct {
	// Synchronization
	sync.Mutex
	// contains filtered or unexported fields
}

PodAggregator tracks status for any Pods related to the owner resource, and writes warning/error messages to a channel that can be consumed by a resource awaiter.

func NewPodAggregator

func NewPodAggregator(owner ResourceID, lister cache.GenericLister) *PodAggregator

NewPodAggregator returns an initialized PodAggregator.

func (*PodAggregator) Read

func (pa *PodAggregator) Read() logging.Messages

Read lists existing Pods and returns any related warning/error messages.

func (*PodAggregator) ResultChan

func (pa *PodAggregator) ResultChan() <-chan logging.Messages

ResultChan returns a reference to the message channel used by the PodAggregator to communicate warning/error messages to a resource awaiter.

func (*PodAggregator) Start

func (pa *PodAggregator) Start(informChan <-chan watch.Event)

Start initiates the aggregation logic and is executed as a goroutine which should be stopped through a call to Stop

func (*PodAggregator) Stop

func (pa *PodAggregator) Stop()

Stop safely stops a PodAggregator and underlying watch client.

type PreviewError

type PreviewError interface {
	Object() *unstructured.Unstructured
}

PreviewError represents a preview operation that failed.

type ProviderConfig

type ProviderConfig struct {
	Context           context.Context
	Host              *pulumiprovider.HostClient
	URN               resource.URN
	InitialAPIVersion string
	FieldManager      string
	ClusterVersion    *cluster.ServerVersion
	ServerSideApply   bool

	ClientSet   *clients.DynamicClientSet
	DedupLogger *logging.DedupLogger
	Resources   k8sopenapi.Resources
}

type ReadConfig

type ReadConfig struct {
	ProviderConfig
	Inputs          *unstructured.Unstructured
	Name            string
	ReadFromCluster bool
}

type ResourceID

type ResourceID struct {
	Name       string
	Namespace  string // Namespace should never be "" (use "default" instead).
	GVK        schema.GroupVersionKind
	Generation int64
}

func ResourceIDFromUnstructured

func ResourceIDFromUnstructured(uns *unstructured.Unstructured) ResourceID

func (ResourceID) GVKString

func (r ResourceID) GVKString() string

func (ResourceID) String

func (r ResourceID) String() string

type UpdateConfig

type UpdateConfig struct {
	ProviderConfig
	Previous *unstructured.Unstructured
	Inputs   *unstructured.Unstructured
	Timeout  float64
	Preview  bool
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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