Documentation
¶
Index ¶
- func GetAppsByHealthStatusCode(apps []argov1alpha1.Application, code health.HealthStatusCode) []argov1alpha1.Application
- func GetAppsBySyncStatusCode(apps []argov1alpha1.Application, code argov1alpha1.SyncStatusCode) []argov1alpha1.Application
- func GetAppsName(apps []argov1alpha1.Application) string
- func GetClustersName(clusters []corev1.Secret) string
- func GetSyncedAppsByStage(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage, ...) []argov1alpha1.Application
- func IsArgoCDCluster(labels map[string]string) bool
- func SortAppsByName(apps []argov1alpha1.Application)
- func SortSecretsByName(secrets *corev1.SecretList)
- type ArgoCDAppClient
- type Configuration
- type InMemorySyncState
- func (s *InMemorySyncState) GetMaxParallel(stage syncv1alpha1.ProgressiveSyncStage) int
- func (s *InMemorySyncState) GetMaxTargets(stage syncv1alpha1.ProgressiveSyncStage) int
- func (s *InMemorySyncState) IsAppMarkedInStage(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage) bool
- func (s *InMemorySyncState) MarkAppAsSynced(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage)
- func (s *InMemorySyncState) RefreshState(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage)
- type ProgressiveSyncState
- type ProgressiveSyncStateManager
- type ProgressiveSyncStateManagerImpl
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAppsByHealthStatusCode ¶
func GetAppsByHealthStatusCode(apps []argov1alpha1.Application, code health.HealthStatusCode) []argov1alpha1.Application
GetAppsByHealthStatusCode returns the Applications matching the specified health status code
func GetAppsBySyncStatusCode ¶
func GetAppsBySyncStatusCode(apps []argov1alpha1.Application, code argov1alpha1.SyncStatusCode) []argov1alpha1.Application
GetAppsBySyncStatusCode returns the Applications matching the specified sync status code
func GetAppsName ¶
func GetAppsName(apps []argov1alpha1.Application) string
GetAppsName returns a string containing a comma-separated list of names of the given apps
func GetClustersName ¶
GetClustersName returns a string containing a comma-separated list of names of the given clusters
func GetSyncedAppsByStage ¶
func GetSyncedAppsByStage(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage, pss ProgressiveSyncState) []argov1alpha1.Application
GetSyncedAppsByStage returns the Applications that synced during the given stage
func IsArgoCDCluster ¶
IsArgoCDCluster returns true if one of the labels is the ArgoCD secret label with the secret type cluster as value
func SortAppsByName ¶
func SortAppsByName(apps []argov1alpha1.Application)
SortAppsByName sort the Application slice in place by the app name
func SortSecretsByName ¶
func SortSecretsByName(secrets *corev1.SecretList)
SortSecretsByName sort the SecretList in place by the secrets name
Types ¶
type ArgoCDAppClient ¶
type ArgoCDAppClient interface {
Sync(ctx context.Context, in *applicationpkg.ApplicationSyncRequest, opts ...grpc.CallOption) (*v1alpha1.Application, error)
}
func GetArgoCDAppClient ¶
func GetArgoCDAppClient(c Configuration) ArgoCDAppClient
GetArgoCDAppClient builds an Argo CD application client with the provided configuration
type Configuration ¶
Configuration holds the configuration to connect to the Argo CD server
func ReadConfiguration ¶
func ReadConfiguration() (Configuration, error)
ReadConfiguration returns a Configuration, reading it from environment variables if present, or from files in the configuration directory otherwise
type InMemorySyncState ¶
type InMemorySyncState struct { Name string SyncedAtStage map[string]string // Key: App name, Value: Stage name SyncedAppsPerStage map[string]int // Key: Stage name, Value: Number of Apps synced in this stage MaxTargetsPerStage map[string]int MaxParallelPerStage map[string]int Mutex *sync.Mutex }
func (*InMemorySyncState) GetMaxParallel ¶
func (s *InMemorySyncState) GetMaxParallel(stage syncv1alpha1.ProgressiveSyncStage) int
GetMaxParallel gets the maximum level of parallelism to be applied when syncing/scheduling apps in the specified stage
func (*InMemorySyncState) GetMaxTargets ¶
func (s *InMemorySyncState) GetMaxTargets(stage syncv1alpha1.ProgressiveSyncStage) int
GetMaxTargets gets the maximum number of targets to be synced in the specified stage
func (*InMemorySyncState) IsAppMarkedInStage ¶
func (s *InMemorySyncState) IsAppMarkedInStage(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage) bool
IsAppMarkedInStage returns whether the application is marked in the specified stage
func (*InMemorySyncState) MarkAppAsSynced ¶
func (s *InMemorySyncState) MarkAppAsSynced(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage)
MarkAppAsSynced marks the specified app as synced in the specified stage
func (*InMemorySyncState) RefreshState ¶
func (s *InMemorySyncState) RefreshState(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage)
RefreshState makes sure that we update our representation of the state of the world to match the latest observation
type ProgressiveSyncState ¶
type ProgressiveSyncState interface { MarkAppAsSynced(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage) RefreshState(apps []argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage) IsAppMarkedInStage(app argov1alpha1.Application, stage syncv1alpha1.ProgressiveSyncStage) bool GetMaxTargets(stage syncv1alpha1.ProgressiveSyncStage) int GetMaxParallel(stage syncv1alpha1.ProgressiveSyncStage) int }
type ProgressiveSyncStateManager ¶
type ProgressiveSyncStateManager interface {
Get(name string) (ProgressiveSyncState, error)
}
func NewProgressiveSyncManager ¶
func NewProgressiveSyncManager() ProgressiveSyncStateManager
NewProgressiveSyncManager returns a ProgressiveSync stage manager
type ProgressiveSyncStateManagerImpl ¶
type ProgressiveSyncStateManagerImpl struct { Mutex *sync.Mutex // contains filtered or unexported fields }
func (*ProgressiveSyncStateManagerImpl) Get ¶
func (p *ProgressiveSyncStateManagerImpl) Get(name string) (ProgressiveSyncState, error)
Get returns the progressive sync state object for the specified progresive sync