Documentation
¶
Index ¶
- Constants
- func IsDeletionOrderReversed(appset *argov1alpha1.ApplicationSet) bool
- func IsRollingSyncStrategy(appset *argov1alpha1.ApplicationSet) bool
- func RollingSyncStrategyEnabled(appset *argov1alpha1.ApplicationSet) bool
- type Dependencies
- type Manager
- func (m *Manager) PerformProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, ...) (map[string]bool, error)
- func (m *Manager) PerformReverseDeletion(ctx context.Context, logCtx *log.Entry, appset argov1alpha1.ApplicationSet, ...) (time.Duration, error)
- func (m *Manager) SyncDesiredApplications(logCtx *log.Entry, applicationSet *argov1alpha1.ApplicationSet, ...) []argov1alpha1.Application
- func (m *Manager) UpdateApplicationSetApplicationStatus(ctx context.Context, logCtx *log.Entry, ...) ([]argov1alpha1.ApplicationSetApplicationStatus, error)
- func (m *Manager) UpdateApplicationSetApplicationStatusProgress(ctx context.Context, logCtx *log.Entry, ...) ([]argov1alpha1.ApplicationSetApplicationStatus, error)
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 ¶
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
Click to show internal directories.
Click to hide internal directories.