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 DispatchRecorder

type DispatchRecorder interface {
	RecordError(clusterName, operation string, err error)
	RecordEvent(clusterName, operation, operationContinuous string)
}

type FederatedResourceForDispatch

type FederatedResourceForDispatch interface {
	TargetName() util.QualifiedName
	TargetKind() string
	Object() *unstructured.Unstructured
	VersionForCluster(clusterName string) (string, error)
	ObjectForCluster(clusterName string) (*unstructured.Unstructured, error)
	RecordError(errorCode string, err error)
	RecordEvent(reason, messageFmt string, args ...interface{})
}

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
}

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, targetKind string, targetName util.QualifiedName) UnmanagedDispatcher