Documentation ¶
Index ¶
Constants ¶
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" )
const (
// Workflow annotation that dictates which OCM Placement this Workflow should use to determine the managed cluster.
AnnotationKeyOCMPlacement = "workflows.argoproj.io/ocm-placement"
)
Variables ¶
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
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 ¶
WorkflowPlacementReconciler reconciles a Workflow object
func (*WorkflowPlacementReconciler) Reconcile ¶
func (r *WorkflowPlacementReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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 ¶
WorkflowReconciler reconciles a Workflow object
func (*WorkflowReconciler) Reconcile ¶
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 ¶
WorkflowStatusReconciler reconciles a Workflow object
func (*WorkflowStatusReconciler) Reconcile ¶
func (r *WorkflowStatusReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctrl.Result, error)
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.