Documentation
¶
Index ¶
- Constants
- func IsDeletionOrderReversed(appset *v1alpha1.ApplicationSet) bool
- func IsRollingSyncStrategy(appset *v1alpha1.ApplicationSet) bool
- func IsStepsEmpty(appset *v1alpha1.ApplicationSet) bool
- func RollingSyncStrategyEnabled(appset *v1alpha1.ApplicationSet) bool
- type Dependencies
- type InvalidMatchExpression
- type InvalidMaxUpdate
- type Manager
- func (m *Manager) PerformProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset v1alpha1.ApplicationSet, ...) (map[string]bool, error)
- func (m *Manager) PerformReverseDeletion(ctx context.Context, logCtx *log.Entry, appset v1alpha1.ApplicationSet, ...) (time.Duration, error)
- func (m *Manager) SyncDesiredApplications(logCtx *log.Entry, applicationSet *v1alpha1.ApplicationSet, ...) []v1alpha1.Application
- func (m *Manager) UpdateApplicationSetApplicationStatus(ctx context.Context, logCtx *log.Entry, ...) ([]v1alpha1.ApplicationSetApplicationStatus, error)
- func (m *Manager) UpdateApplicationSetApplicationStatusProgress(ctx context.Context, logCtx *log.Entry, ...) ([]v1alpha1.ApplicationSetApplicationStatus, error)
- type ValidationIssues
Constants ¶
const ( ReverseDeletionOrder = "Reverse" AllAtOnceDeletionOrder = "AllAtOnce" )
Variables ¶
This section is empty.
Functions ¶
func IsDeletionOrderReversed ¶
func IsDeletionOrderReversed(appset *v1alpha1.ApplicationSet) bool
func IsRollingSyncStrategy ¶
func IsRollingSyncStrategy(appset *v1alpha1.ApplicationSet) bool
func IsStepsEmpty ¶
func IsStepsEmpty(appset *v1alpha1.ApplicationSet) bool
func RollingSyncStrategyEnabled ¶
func RollingSyncStrategyEnabled(appset *v1alpha1.ApplicationSet) bool
Types ¶
type Dependencies ¶
type Dependencies interface {
// SetAppSetApplicationStatus persists ApplicationSet status.ApplicationStatus field
SetAppSetApplicationStatus(
ctx context.Context,
logCtx *log.Entry,
applicationSet *v1alpha1.ApplicationSet,
applicationStatuses []v1alpha1.ApplicationSetApplicationStatus,
) error
// SetApplicationSetStatusCondition persists ApplicationSet conditions
SetApplicationSetStatusCondition(
ctx context.Context,
applicationSet *v1alpha1.ApplicationSet,
conditions []v1alpha1.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 InvalidMatchExpression ¶
type InvalidMatchExpression struct {
StepIndex int // 0-based step index
Operator string // the invalid operator value
}
InvalidMatchExpression represents a step with an invalid matchExpression operator
type InvalidMaxUpdate ¶
type InvalidMaxUpdate struct {
StepIndex int
MaxUpdate *intstr.IntOrString
Error string
}
InvalidMaxUpdate represents a step with an invalid maxUpdate value
type Manager ¶
func NewManager ¶
func NewManager(client client.Client, dependencies Dependencies) *Manager
NewManager creates a new manager with dependencies
func (*Manager) PerformProgressiveSyncs ¶
func (m *Manager) PerformProgressiveSyncs(ctx context.Context, logCtx *log.Entry, appset v1alpha1.ApplicationSet, applications []v1alpha1.Application, desiredApplications []v1alpha1.Application) (map[string]bool, error)
func (*Manager) PerformReverseDeletion ¶
func (*Manager) SyncDesiredApplications ¶
func (m *Manager) SyncDesiredApplications(logCtx *log.Entry, applicationSet *v1alpha1.ApplicationSet, appsToSync map[string]bool, desiredApplications []v1alpha1.Application) []v1alpha1.Application
func (*Manager) UpdateApplicationSetApplicationStatus ¶
func (m *Manager) UpdateApplicationSetApplicationStatus(ctx context.Context, logCtx *log.Entry, applicationSet *v1alpha1.ApplicationSet, applications []v1alpha1.Application, desiredApplications []v1alpha1.Application, appStepMap map[string]int) ([]v1alpha1.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 *v1alpha1.ApplicationSet, appsToSync map[string]bool, appStepMap map[string]int) ([]v1alpha1.ApplicationSetApplicationStatus, error)
check Applications that are in Waiting status and promote them to Pending if needed
type ValidationIssues ¶
type ValidationIssues struct {
InvalidMatchExpressions []InvalidMatchExpression
DuplicateAppSelections map[string][]int
EmptySteps []int // step indices (0-based) with no matching apps
InvalidMaxUpdates []InvalidMaxUpdate
}
ValidationIssues holds all validation problems detected during progressive sync
func (*ValidationIssues) HasIssues ¶
func (v *ValidationIssues) HasIssues() bool
HasIssues returns true if any validation issues exist