dispatch

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2020 License: Apache-2.0 Imports: 18 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RetainClusterFields

func RetainClusterFields(targetKind string, desiredObj, clusterObj, fedObj *unstructured.Unstructured) error

RetainClusterFields updates the desired object with values retained from the cluster object.

Types

type CheckUnmanagedDispatcher added in v0.3.0

type CheckUnmanagedDispatcher interface {
	OperationDispatcher

	CheckRemovedOrUnlabeled(clusterName string, isHostNamespace isNamespaceInHostClusterFunc)
}

func NewCheckUnmanagedDispatcher added in v0.3.0

func NewCheckUnmanagedDispatcher(clientAccessor clientAccessorFunc, targetGVK schema.GroupVersionKind, targetName util.QualifiedName) CheckUnmanagedDispatcher

type FederatedResourceForDispatch

type FederatedResourceForDispatch interface {
	TargetName() util.QualifiedName
	TargetKind() string
	TargetGVK() schema.GroupVersionKind
	Object() *unstructured.Unstructured
	VersionForCluster(clusterName string) (string, error)
	ObjectForCluster(clusterName string) (*unstructured.Unstructured, error)
	ApplyOverrides(obj *unstructured.Unstructured, clusterName string) error
	RecordError(errorCode string, err error)
	RecordEvent(reason, messageFmt string, args ...interface{})
	IsNamespaceInHostCluster(clusterObj pkgruntime.Object) bool
}

FederatedResourceForDispatch is the subset of the FederatedResource interface required for dispatching operations to managed resources.

type ManagedDispatcher

type ManagedDispatcher interface {
	UnmanagedDispatcher

	Create(clusterName string)
	Update(clusterName string, clusterObj *unstructured.Unstructured)
	VersionMap() map[string]string
	CollectedStatus() status.CollectedPropagationStatus

	RecordClusterError(propStatus status.PropagationStatus, clusterName string, err error)
	RecordStatus(clusterName string, propStatus status.PropagationStatus)
}

ManagedDispatcher dispatches operations to member clusters for resources managed by a federated resource.

func NewManagedDispatcher

func NewManagedDispatcher(clientAccessor clientAccessorFunc, fedResource FederatedResourceForDispatch, skipAdoptingResources bool) ManagedDispatcher

type OperationDispatcher

type OperationDispatcher interface {
	// Wait returns true for ok if all operations completed
	// successfully and false if only some operations completed
	// successfully.  An error is returned on timeout.
	Wait() (ok bool, timeoutErr error)
}

OperationDispatcher provides an interface to wait for operations dispatched to member clusters.

type UnmanagedDispatcher

type UnmanagedDispatcher interface {
	OperationDispatcher

	Delete(clusterName string)
	RemoveManagedLabel(clusterName string, clusterObj *unstructured.Unstructured)
}

UnmanagedDispatcher dispatches operations to member clusters for resources that are no longer managed by a federated resource.

func NewUnmanagedDispatcher

func NewUnmanagedDispatcher(clientAccessor clientAccessorFunc, targetGVK schema.GroupVersionKind, targetName util.QualifiedName) UnmanagedDispatcher

Jump to

Keyboard shortcuts

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