controller

package
v2.11.7 Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2024 License: Apache-2.0 Imports: 78 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EnvClusterInfoTimeout = "ARGO_CD_UPDATE_CLUSTER_INFO_TIMEOUT"
)
View Source
const (
	// EnvVarSyncWaveDelay is an environment variable which controls the delay in seconds between
	// each sync-wave
	EnvVarSyncWaveDelay = "ARGOCD_SYNC_WAVE_DELAY"
)

Variables

View Source
var (
	CompareStateRepoError = errors.New("failed to get repo objects")
)

Functions

func DeduplicateTargetObjects

func DeduplicateTargetObjects(
	namespace string,
	objs []*unstructured.Unstructured,
	infoProvider kubeutil.ResourceInfoProvider,
) ([]*unstructured.Unstructured, []v1alpha1.ApplicationCondition, error)

func FilterObjectsForDeletion

func FilterObjectsForDeletion(objs []*unstructured.Unstructured) []*unstructured.Unstructured

func NewClusterInfoUpdater

func NewClusterInfoUpdater(
	infoSource metrics.HasClustersInfo,
	db db.ArgoDB,
	appLister v1alpha1.ApplicationNamespaceLister,
	cache *appstatecache.Cache,
	clusterFilter func(cluster *appv1.Cluster) bool,
	projGetter func(app *appv1.Application) (*appv1.AppProject, error),
	namespace string) *clusterInfoUpdater

Types

type AppStateManager

type AppStateManager interface {
	CompareAppState(app *v1alpha1.Application, project *v1alpha1.AppProject, revisions []string, sources []v1alpha1.ApplicationSource, noCache bool, noRevisionCache bool, localObjects []string, hasMultipleSources bool) (*comparisonResult, error)
	SyncAppState(app *v1alpha1.Application, state *v1alpha1.OperationState)
	GetRepoObjs(app *v1alpha1.Application, sources []v1alpha1.ApplicationSource, appLabelKey string, revisions []string, noCache, noRevisionCache, verifySignature bool, proj *v1alpha1.AppProject) ([]*unstructured.Unstructured, []*apiclient.ManifestResponse, error)
}

AppStateManager defines methods which allow to compare application spec and actual application state.

func NewAppStateManager

func NewAppStateManager(
	db db.ArgoDB,
	appclientset appclientset.Interface,
	repoClientset apiclient.Clientset,
	namespace string,
	kubectl kubeutil.Kubectl,
	settingsMgr *settings.SettingsManager,
	liveStateCache statecache.LiveStateCache,
	projInformer cache.SharedIndexInformer,
	metricsServer *metrics.MetricsServer,
	cache *appstatecache.Cache,
	statusRefreshTimeout time.Duration,
	resourceTracking argo.ResourceTracking,
	persistResourceHealth bool,
	repoErrorGracePeriod time.Duration,
	serverSideDiff bool,
	ignoreNormalizerOpts normalizers.IgnoreNormalizerOpts,
) AppStateManager

NewAppStateManager creates new instance of AppStateManager

type ApplicationController

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

ApplicationController is the controller for application resources.

func NewApplicationController

func NewApplicationController(
	namespace string,
	settingsMgr *settings_util.SettingsManager,
	kubeClientset kubernetes.Interface,
	applicationClientset appclientset.Interface,
	repoClientset apiclient.Clientset,
	argoCache *appstatecache.Cache,
	kubectl kube.Kubectl,
	appResyncPeriod time.Duration,
	appHardResyncPeriod time.Duration,
	appResyncJitter time.Duration,
	selfHealTimeout time.Duration,
	repoErrorGracePeriod time.Duration,
	metricsPort int,
	metricsCacheExpiration time.Duration,
	metricsApplicationLabels []string,
	kubectlParallelismLimit int64,
	persistResourceHealth bool,
	clusterSharding sharding.ClusterShardingCache,
	applicationNamespaces []string,
	rateLimiterConfig *ratelimiter.AppControllerRateLimiterConfig,
	serverSideDiff bool,
	dynamicClusterDistributionEnabled bool,
	ignoreNormalizerOpts normalizers.IgnoreNormalizerOpts,
) (*ApplicationController, error)

NewApplicationController creates new instance of ApplicationController.

func (*ApplicationController) GetMetricsServer

func (ctrl *ApplicationController) GetMetricsServer() *metrics.MetricsServer

func (*ApplicationController) InvalidateProjectsCache added in v2.2.0

func (ctrl *ApplicationController) InvalidateProjectsCache(names ...string)

func (*ApplicationController) PatchAppWithWriteBack added in v2.10.0

func (ctrl *ApplicationController) PatchAppWithWriteBack(ctx context.Context, name, ns string, pt types.PatchType, data []byte, opts metav1.PatchOptions, subresources ...string) (result *appv1.Application, err error)

PatchAppWithWriteBack patches an application and writes it back to the informer cache

func (*ApplicationController) RegisterClusterSecretUpdater

func (ctrl *ApplicationController) RegisterClusterSecretUpdater(ctx context.Context)

func (*ApplicationController) Run

func (ctrl *ApplicationController) Run(ctx context.Context, statusProcessors int, operationProcessors int)

Run starts the Application CRD controller.

type ClusterFilterFunction added in v2.8.0

type ClusterFilterFunction func(c *appv1.Cluster, distributionFunction sharding.DistributionFunction) bool

type CompareWith

type CompareWith int
const (
	// Compare live application state against state defined in latest git revision with no resolved revision caching.
	CompareWithLatestForceResolve CompareWith = 3
	// Compare live application state against state defined in latest git revision.
	CompareWithLatest CompareWith = 2
	// Compare live application state against state defined using revision of most recent comparison.
	CompareWithRecent CompareWith = 1
	// Skip comparison and only refresh application resources tree
	ComparisonWithNothing CompareWith = 0
)

func (CompareWith) Max

func (CompareWith) Pointer

func (a CompareWith) Pointer() *CompareWith

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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