agent

package
v0.0.0-...-263f077 Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AnnotationKeyHubWorkflowUID = "workflows.argoproj.io/ocm-hub-workflow-uid"
)

Variables

View Source
var WorkflowPredicateFunctions = predicate.Funcs{

	UpdateFunc: func(e event.UpdateEvent) bool {
		newWf := e.ObjectNew.(*argov1alpha1.Workflow)
		oldWf := e.ObjectOld.(*argov1alpha1.Workflow)

		return containsValidOCMAnnotation(*newWf) && !reflect.DeepEqual(newWf.Status, oldWf.Status)
	},
	CreateFunc: func(e event.CreateEvent) bool {
		workflow := e.Object.(*argov1alpha1.Workflow)
		return containsValidOCMAnnotation(*workflow)
	},

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

Functions

func NewAgentCommand

func NewAgentCommand(addonName string, logger logr.Logger) *cobra.Command

Types

type AgentOptions

type AgentOptions struct {
	Log               logr.Logger
	HubKubeconfigFile string
	SpokeClusterName  string
	AddonName         string
	AddonNamespace    string
}

AgentOptions defines the flags for workload agent

func NewAgentOptions

func NewAgentOptions(addonName string, logger logr.Logger) *AgentOptions

NewWorkloadAgentOptions returns the flags with default value set

func (*AgentOptions) AddFlags

func (o *AgentOptions) AddFlags(cmd *cobra.Command)

type ArgoWorkflowStatusController

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

func (*ArgoWorkflowStatusController) Reconcile

Reconcile Workflow status changes and create/update a Workflow CR in the hub cluster's managed cluster namespace This agent only has permission to create/update in that particular namespace so the hub cluster will need another controller that sync the Workflow status from hub's managed cluster namespace to the original dormant Workflow.

func (*ArgoWorkflowStatusController) SetupWithManager

func (c *ArgoWorkflowStatusController) SetupWithManager(mgr ctrl.Manager) error

Jump to

Keyboard shortcuts

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