work

package
v0.11.3 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 38 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// WorkAvailableReason is the reason string of condition when the manifest is available.
	WorkAvailableReason = "WorkAvailable"
	// WorkNotTrackableReason is the reason string of condition when the manifest is already up to date but we don't have
	// a way to track its availabilities.
	WorkNotTrackableReason = "WorkNotTrackable"
	// ManifestApplyFailedReason is the reason string of condition when it failed to apply manifest.
	ManifestApplyFailedReason = "ManifestApplyFailed"
	// ApplyConflictBetweenPlacementsReason is the reason string of condition when the manifest is owned by multiple placements,
	// and they have conflicts.
	ApplyConflictBetweenPlacementsReason = "ApplyConflictBetweenPlacements"
	// ManifestsAlreadyOwnedByOthersReason is the reason string of condition when the manifest is already owned by other
	// non-fleet appliers.
	ManifestsAlreadyOwnedByOthersReason = "ManifestsAlreadyOwnedByOthers"
	// ManifestAlreadyUpToDateReason is the reason string of condition when the manifest is already up to date.
	ManifestAlreadyUpToDateReason = "ManifestAlreadyUpToDate"

	// ManifestNeedsUpdateReason is the reason string of condition when the manifest needs to be updated.
	ManifestNeedsUpdateReason = "ManifestNeedsUpdate"
)

WorkCondition condition reasons

Variables

This section is empty.

Functions

This section is empty.

Types

type Applier added in v0.9.5

type Applier interface {
	ApplyUnstructured(ctx context.Context, applyStrategy *fleetv1beta1.ApplyStrategy, gvr schema.GroupVersionResource, manifestObj *unstructured.Unstructured) (*unstructured.Unstructured, ApplyAction, error)
}

Applier is the interface to apply the resources on the member clusters.

type ApplyAction added in v0.9.5

type ApplyAction string

ApplyAction represents the action we take to apply the manifest. It is used only internally to track the result of the apply function. +enum

type ApplyWorkReconciler

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

ApplyWorkReconciler reconciles a Work object

func NewApplyWorkReconciler

func NewApplyWorkReconciler(hubClient client.Client, spokeDynamicClient dynamic.Interface, spokeClient client.Client,
	restMapper meta.RESTMapper, recorder record.EventRecorder, concurrency int, workNameSpace string) *ApplyWorkReconciler

func (*ApplyWorkReconciler) Join

Join starts to reconcile

func (*ApplyWorkReconciler) Leave

func (r *ApplyWorkReconciler) Leave(ctx context.Context) error

Leave start

func (*ApplyWorkReconciler) Reconcile

func (r *ApplyWorkReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)

Reconcile implement the control loop logic for Work object.

func (*ApplyWorkReconciler) SetupWithManager

func (r *ApplyWorkReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager wires up the controller.

type ClientSideApplier added in v0.9.5

type ClientSideApplier struct {
	HubClient          client.Client
	WorkNamespace      string
	SpokeDynamicClient dynamic.Interface
}

ClientSideApplier applies the manifest to the cluster and fails if the resource already exists.

func (*ClientSideApplier) ApplyUnstructured added in v0.9.5

ApplyUnstructured determines if an unstructured manifest object can & should be applied. It first validates the size of the last modified annotation of the manifest, it removes the annotation if the size crosses the annotation size threshold and then creates/updates the resource on the cluster using server side apply instead of three-way merge patch.

type ServerSideApplier added in v0.9.5

type ServerSideApplier struct {
	HubClient          client.Client
	WorkNamespace      string
	SpokeDynamicClient dynamic.Interface
}

ServerSideApplier applies the manifest to the cluster using server side apply.

func (*ServerSideApplier) ApplyUnstructured added in v0.9.5

ApplyUnstructured applies the manifest to the cluster using server side apply according to the given apply strategy.

Jump to

Keyboard shortcuts

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