progressivesync

package
v3.5.3 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2026 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ReverseDeletionOrder   = "Reverse"
	AllAtOnceDeletionOrder = "AllAtOnce"
)

Variables

This section is empty.

Functions

func IsDeletionOrderReversed

func IsDeletionOrderReversed(appset *argov1alpha1.ApplicationSet) bool

func IsRollingSyncStrategy

func IsRollingSyncStrategy(appset *argov1alpha1.ApplicationSet) bool

func RollingSyncStrategyEnabled

func RollingSyncStrategyEnabled(appset *argov1alpha1.ApplicationSet) bool

Types

type Dependencies

type Dependencies interface {
	// SetAppSetApplicationStatus persists ApplicationSet status.ApplicationStatus field
	SetAppSetApplicationStatus(
		ctx context.Context,
		logCtx *log.Entry,
		applicationSet *argov1alpha1.ApplicationSet,
		applicationStatuses []argov1alpha1.ApplicationSetApplicationStatus,
	) error

	// SetApplicationSetStatusCondition persists ApplicationSet conditions
	SetApplicationSetStatusCondition(
		ctx context.Context,
		applicationSet *argov1alpha1.ApplicationSet,
		condition argov1alpha1.ApplicationSetCondition,
		parametersGenerated bool,
	) error
}

Dependencies is the interface for dependencies of the Manager. It serves two purposes: 1) it prevents progressive sync from having direct access to the ApplicationSet controller, and 2) it allows for easy mocking in tests.

type Manager

type Manager struct {
	Client client.Client
	// APIReader reads directly from the API server, bypassing the informer cache. Reverse deletion
	// uses it to double-check an Application the cache has reported as terminating for an
	// implausibly long time, since the cache alone cannot distinguish a slow teardown from a DELETED
	// event that was never delivered. Required: with no uncached reader the cache cannot be verified,
	// so past the threshold reverse deletion errors rather than trusting it. Production supplies
	// mgr.GetAPIReader().
	APIReader client.Reader
	// contains filtered or unexported fields
}

func NewManager

func NewManager(client client.Client, apiReader client.Reader, dependencies Dependencies) *Manager

NewManager creates a new manager with dependencies

func (*Manager) PerformProgressiveSyncs

func (m *Manager) PerformProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application) (map[string]bool, error)

func (*Manager) PerformReverseDeletion

func (m *Manager) PerformReverseDeletion(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, currentApps []argov1alpha1.Application) (time.Duration, error)

func (*Manager) SyncDesiredApplications

func (m *Manager) SyncDesiredApplications(logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, appsToSync map[string]bool, desiredApplications []argov1alpha1.Application) []argov1alpha1.Application

func (*Manager) UpdateApplicationSetApplicationStatus

func (m *Manager) UpdateApplicationSetApplicationStatus(ctx context.Context, logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, applications []argov1alpha1.Application, desiredApplications []argov1alpha1.Application, appStepMap map[string]int) ([]argov1alpha1.ApplicationSetApplicationStatus, error)

check the status of each Application's status and promote Applications to the next status if needed update AppSet status in-memory, controller will persist it

func (*Manager) UpdateApplicationSetApplicationStatusProgress

func (m *Manager) UpdateApplicationSetApplicationStatusProgress(ctx context.Context, logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, appsToSync map[string]bool, appStepMap map[string]int) ([]argov1alpha1.ApplicationSetApplicationStatus, error)

check Applications that are in Waiting status and promote them to Pending if needed

Jump to

Keyboard shortcuts

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