backend

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2025 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Overview

Package backend provides the interface for implementing Application providers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppProject

type AppProject interface {
	List(ctx context.Context, selector AppProjectSelector) ([]v1alpha1.AppProject, error)
	Create(ctx context.Context, app *v1alpha1.AppProject) (*v1alpha1.AppProject, error)
	Get(ctx context.Context, name string, namespace string) (*v1alpha1.AppProject, error)
	Delete(ctx context.Context, name string, namespace string, deletionPropagation *DeletionPropagation) error
	Update(ctx context.Context, app *v1alpha1.AppProject) (*v1alpha1.AppProject, error)
	Patch(ctx context.Context, name string, namespace string, patch []byte) (*v1alpha1.AppProject, error)
	SupportsPatch() bool
	StartInformer(ctx context.Context) error
	EnsureSynced(duration time.Duration) error
}

AppProject defines a generic interface to store/track Argo CD AppProject state, via AppProjectManager.

As of this writing (August 2024), the only implementation is a Kubernetes-based backend (KubernetesBackend in 'internal/backend/kubernetes/appproject') but other backends (e.g. RDBMS-backed) could be implemented in the future.

type AppProjectSelector

type AppProjectSelector struct {
	// Labels is not currently implemented.
	Labels map[string]string

	// Namespaces is used by the 'List' AppProject interface function to restrict the list of AppProjects returned to a specific set of Namespaces.
	Namespaces []string

	// Names is not currently implemented.
	Names []string
}

type Application

type Application interface {
	List(ctx context.Context, selector ApplicationSelector) ([]v1alpha1.Application, error)
	Create(ctx context.Context, app *v1alpha1.Application) (*v1alpha1.Application, error)
	Get(ctx context.Context, name string, namespace string) (*v1alpha1.Application, error)
	Delete(ctx context.Context, name string, namespace string, deletionPropagation *DeletionPropagation) error
	Update(ctx context.Context, app *v1alpha1.Application) (*v1alpha1.Application, error)
	Patch(ctx context.Context, name string, namespace string, patch []byte) (*v1alpha1.Application, error)
	SupportsPatch() bool
	StartInformer(ctx context.Context) error
	EnsureSynced(duration time.Duration) error
}

Application defines a generic interface to store/track Argo CD Application state, via ApplicationManager.

As of this writing (August 2024), the only implementation is a Kubernetes-based backend (KubernetesBackend in 'internal/backend/kubernetes/application') but other backends (e.g. RDBMS-backed) could be implemented in the future.

type ApplicationSelector

type ApplicationSelector struct {

	// Labels is not currently implemented.
	Labels map[string]string

	// Names is not currently implemented.
	Names []string

	// Namespaces is used by the 'List' Application interface function to restrict the list of Applications returned to a specific set of Namespaces.
	Namespaces []string

	// Projects is not currently implemented.
	Projects []string
}

type DeletionPropagation

type DeletionPropagation string

DeletionPropagation is based on the kubernetes DeletionPropagation API, and follows its behaviours for deletion propagation, specifically that it controls how deletion will propagate to the dependents of the object (and corresponding GC behaviour)

const (
	// Orphans the dependents: the object is deleted, the dependents are not.
	DeletePropagationOrphan DeletionPropagation = "Orphan"

	// The object is deleted, and any dependent objects are deleted in the background.
	DeletePropagationBackground DeletionPropagation = "Background"

	// The object continues to exist until all dependents are deleted. This same behaviour cascades to dependent objects.
	DeletePropagationForeground DeletionPropagation = "Foreground"
)

type Namespace

type Namespace interface {
	StartInformer(ctx context.Context) error
	EnsureSynced(duration time.Duration) error
}

Namespace defines a generic interface to track agent namespaces.

Directories

Path Synopsis
kubernetes
application
Package kubernetes implements an Application backend that uses a Kubernetes informer to keep track of resources, and an appclientset to manipulate Application resources on the cluster.
Package kubernetes implements an Application backend that uses a Kubernetes informer to keep track of resources, and an appclientset to manipulate Application resources on the cluster.
appproject
Package kubernetes implements an AppProject backend that uses a Kubernetes informer to keep track of resources, and an appclientset to manipulate AppProject resources on the cluster.
Package kubernetes implements an AppProject backend that uses a Kubernetes informer to keep track of resources, and an appclientset to manipulate AppProject resources on the cluster.

Jump to

Keyboard shortcuts

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