Documentation ¶
Index ¶
- Constants
- type ApplicationManager
- func (m *ApplicationManager) ClearIgnored()
- func (m *ApplicationManager) ClearManaged()
- func (m *ApplicationManager) Create(ctx context.Context, app *v1alpha1.Application) (*v1alpha1.Application, error)
- func (m *ApplicationManager) Delete(ctx context.Context, namespace string, incoming *v1alpha1.Application) error
- func (m *ApplicationManager) IgnoreChange(appName string, version string) error
- func (m *ApplicationManager) IsChangeIgnored(appName string, version string) bool
- func (m *ApplicationManager) IsManaged(appName string) bool
- func (m *ApplicationManager) Manage(appName string) error
- func (m *ApplicationManager) RemoveFinalizers(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
- func (m *ApplicationManager) UnignoreChange(appName string) error
- func (m *ApplicationManager) Unmanage(appName string) error
- func (m *ApplicationManager) UpdateAutonomousApp(ctx context.Context, namespace string, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
- func (m *ApplicationManager) UpdateManagedApp(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
- func (m *ApplicationManager) UpdateOperation(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
- func (m *ApplicationManager) UpdateStatus(ctx context.Context, namespace string, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
- type ApplicationManagerOption
Constants ¶
const LastUpdatedAnnotation = "argocd-agent.argoproj.io/last-updated"
LastUpdatedAnnotation is a label put on applications which contains the time when an update was last received for this Application
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApplicationManager ¶
type ApplicationManager struct { AllowUpsert bool Application backend.Application Metrics *metrics.ApplicationClientMetrics Role manager.ManagerRole Mode manager.ManagerMode Namespace string // contains filtered or unexported fields }
ApplicationManager manages Argo CD application resources on a given backend.
It provides primitives to create, update, upsert and delete applications.
func NewApplicationManager ¶
func NewApplicationManager(be backend.Application, namespace string, opts ...ApplicationManagerOption) *ApplicationManager
NewApplicationManager initializes and returns a new Manager with the given backend and options.
func (*ApplicationManager) ClearIgnored ¶
func (m *ApplicationManager) ClearIgnored()
func (*ApplicationManager) ClearManaged ¶
func (m *ApplicationManager) ClearManaged()
ClearManaged clears the managed apps
func (*ApplicationManager) Create ¶
func (m *ApplicationManager) Create(ctx context.Context, app *v1alpha1.Application) (*v1alpha1.Application, error)
Create creates the application app using the Manager's application backend.
func (*ApplicationManager) Delete ¶
func (m *ApplicationManager) Delete(ctx context.Context, namespace string, incoming *v1alpha1.Application) error
Delete will delete an application resource. If Delete is called by the principal, any existing finalizers will be removed before deletion is attempted.
func (*ApplicationManager) IgnoreChange ¶
func (m *ApplicationManager) IgnoreChange(appName string, version string) error
IgnoreChange adds a particular version for the application named appName to list of changes to ignore.
func (*ApplicationManager) IsChangeIgnored ¶
func (m *ApplicationManager) IsChangeIgnored(appName string, version string) bool
IsChangeIgnored returns true if the version for appName is already being ignored.
func (*ApplicationManager) IsManaged ¶
func (m *ApplicationManager) IsManaged(appName string) bool
IsManaged returns whether the app appName is currently managed by this agent
func (*ApplicationManager) Manage ¶
func (m *ApplicationManager) Manage(appName string) error
Manage marks the app appName as being managed by this agent
func (*ApplicationManager) RemoveFinalizers ¶
func (m *ApplicationManager) RemoveFinalizers(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
RemoveFinalizers will remove finalizers on an existing application
func (*ApplicationManager) UnignoreChange ¶
func (m *ApplicationManager) UnignoreChange(appName string) error
func (*ApplicationManager) Unmanage ¶
func (m *ApplicationManager) Unmanage(appName string) error
Unmanage marks the app appName as not being managed by this agent
func (*ApplicationManager) UpdateAutonomousApp ¶
func (m *ApplicationManager) UpdateAutonomousApp(ctx context.Context, namespace string, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
UpdateAutonomousApp updates the Application resource on the control plane side when the agent is in autonomous mode. It will update changes to .spec and .status fields along with syncing labels and annotations.
Additionally, it will remove any .operation field from the incoming resource before the resource is being updated on the control plane.
This method is usually only executed by the control plane for updates that are received by agents in autonomous mode.
func (*ApplicationManager) UpdateManagedApp ¶
func (m *ApplicationManager) UpdateManagedApp(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
UpdateManagedApp updates the Application resource on the agent when it is in managed mode.
The app on the agent will inherit labels and annotations as well as the spec and any operation field of the incoming application. A possibly existing refresh annotation on the agent's app will be retained, because it will be removed by the agent's application controller.
func (*ApplicationManager) UpdateOperation ¶
func (m *ApplicationManager) UpdateOperation(ctx context.Context, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
UpdateOperation is used to update the .operation field of the application resource to initiate a sync. Additionally, any labels and annotations that are used to trigger an action (such as, refresh) will be set on the target resource.
This method is usually executed only by an agent in autonomous mode, because it has the leading version of the resource and we are not supposed to change its Application manifests.
func (*ApplicationManager) UpdateStatus ¶
func (m *ApplicationManager) UpdateStatus(ctx context.Context, namespace string, incoming *v1alpha1.Application) (*v1alpha1.Application, error)
UpdateStatus updates the application on the server for updates sent by an agent that operates in managed mode.
The app on the server will inherit the status field of the incoming app. Additionally, if a refresh annotation exists on the app on the app of the server, but not in the incoming app, the annotation will be removed. Any operation field on the existing resource will be removed as well.
type ApplicationManagerOption ¶
type ApplicationManagerOption func(*ApplicationManager)
ApplicationManagerOption is a callback function to set an option to the Application manager
func WithAllowUpsert ¶
func WithAllowUpsert(upsert bool) ApplicationManagerOption
WithAllowUpsert sets the upsert operations allowed flag
func WithMetrics ¶
func WithMetrics(m *metrics.ApplicationClientMetrics) ApplicationManagerOption
WithMetrics sets the metrics provider for the Manager
func WithMode ¶
func WithMode(mode manager.ManagerMode) ApplicationManagerOption
WithMode sets the mode of the Application manager
func WithRole ¶
func WithRole(role manager.ManagerRole) ApplicationManagerOption
WithRole sets the role of the Application manager