progressivesync

package
v1.8.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
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

type Manager struct {
	Client client.Client
	// contains filtered or unexported fields
}

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 (m *Manager) PerformReverseDeletion(ctx context.Context, logCtx *log.Entry, appset v1alpha1.ApplicationSet, currentApps []v1alpha1.Application) (time.Duration, error)

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

Jump to

Keyboard shortcuts

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