workflow

package
v0.0.0-...-f443c0e Latest Latest
Warning

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

Go to latest
Published: May 5, 2023 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Workflow annotation that dictates which managed cluster this Workflow should be propagated to.
	AnnotationKeyOCMManagedCluster = "workflows.argoproj.io/ocm-managed-cluster"
	// Workflow annotation that dictates which managed cluster namespace this Workflow should be propagated to.
	AnnotationKeyOCMManagedClusterNamespace = "workflows.argoproj.io/ocm-managed-cluster-namespace"
	// ManifestWork annotation that shows the namespace of the hub Workflow.
	AnnotationKeyHubWorkflowNamespace = "workflows.argoproj.io/ocm-hub-workflow-namespace"
	// ManifestWork annotation that shows the name of the hub Workflow.
	AnnotationKeyHubWorkflowName = "workflows.argoproj.io/ocm-hub-workflow-name"
	// Workflow label that enables the controller to wrap the Workflow in ManifestWork payload.
	LabelKeyEnableOCMMulticluster = "workflows.argoproj.io/enable-ocm-multicluster"
	// FinalizerCleanupManifestWork is added to the Workflow so the associated ManifestWork gets cleaned up after a Workflow deletion.
	FinalizerCleanupManifestWork = "workflows.argoproj.io/cleanup-ocm-manifestwork"
)
View Source
const (
	// Workflow annotation that dictates which OCM Placement this Workflow should use to determine the managed cluster.
	AnnotationKeyOCMPlacement = "workflows.argoproj.io/ocm-placement"
)

Variables

View Source
var WorkflowPlacementPredicateFunctions = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		newWorkflow := e.ObjectNew.(*argov1alpha1.Workflow)
		return containsValidOCMLabel(*newWorkflow) && containsValidOCMPlacementAnnotation(*newWorkflow)

	},
	CreateFunc: func(e event.CreateEvent) bool {
		workflow := e.Object.(*argov1alpha1.Workflow)
		return containsValidOCMLabel(*workflow) && containsValidOCMPlacementAnnotation(*workflow)
	},

	DeleteFunc: func(e event.DeleteEvent) bool {
		return false
	},
}

WorkflowPredicateFunctions defines which Workflow this controller evaluate the placement decision

View Source
var WorkflowPredicateFunctions = predicate.Funcs{
	UpdateFunc: func(e event.UpdateEvent) bool {
		newWorkflow := e.ObjectNew.(*argov1alpha1.Workflow)
		return containsValidOCMLabel(*newWorkflow) && containsValidOCMAnnotation(*newWorkflow)

	},
	CreateFunc: func(e event.CreateEvent) bool {
		workflow := e.Object.(*argov1alpha1.Workflow)
		return containsValidOCMLabel(*workflow) && containsValidOCMAnnotation(*workflow)
	},

	DeleteFunc: func(e event.DeleteEvent) bool {
		workflow := e.Object.(*argov1alpha1.Workflow)
		return containsValidOCMLabel(*workflow) && containsValidOCMAnnotation(*workflow)
	},
}

WorkflowPredicateFunctions defines which Workflow this controller should wrap inside ManifestWork's payload

Functions

func ContainsCleanupFinalizer

func ContainsCleanupFinalizer(workflow argov1alpha1.Workflow) bool

Types

type WorkflowPlacementReconciler

type WorkflowPlacementReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

WorkflowPlacementReconciler reconciles a Workflow object

func (*WorkflowPlacementReconciler) Reconcile

Reconcile evaluates the PlacementDecision based on the Placement reference then populates the ManagedCluster annotation with the result

func (*WorkflowPlacementReconciler) SetupWithManager

func (re *WorkflowPlacementReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

type WorkflowReconciler

type WorkflowReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

WorkflowReconciler reconciles a Workflow object

func (*WorkflowReconciler) Reconcile

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

Reconcile create/update/delete ManifestWork with the Workflow as its payload

func (*WorkflowReconciler) SetupWithManager

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

SetupWithManager sets up the controller with the Manager.

type WorkflowStatusReconciler

type WorkflowStatusReconciler struct {
	client.Client
	Scheme *runtime.Scheme
}

WorkflowStatusReconciler reconciles a Workflow object

func (*WorkflowStatusReconciler) Reconcile

Reconcile populates the Workflow status based on the associated WorkflowStatusResult The status sync flow: Workflow (dormant) on hub cluster is created and it will be propagated to managed cluster(s) => Workflow on managed cluster (contains annotations that reference the hub cluster dormant Workflow) => The managed cluster status sync agent will create/update a WorkflowStatusResult on the hub cluster (contains annotations that reference the hub cluster dormant Workflow) => using the references from WorkflowStatusResult this reconciler finds the dormant Workflow and populates the status.

func (*WorkflowStatusReconciler) SetupWithManager

func (re *WorkflowStatusReconciler) SetupWithManager(mgr ctrl.Manager) error

SetupWithManager sets up the controller with the Manager.

Jump to

Keyboard shortcuts

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