* fix: status.sync.comparedTo should use replace patch strategy
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* add e2e tests
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
---------
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* feat(sharding): use a cache
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* cluster cmd
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* - Assign shard 0 to in-cluster cluster and nil check updates
- Caching clusters while sharding: Fixing unit tests
- Update generated docs
- Debug e2e tests
- Default the shardNumber to the number of replicas if it is calculated to a higher value
- defered Unlock only when a lock is set
- Disabling temporarly other versions of k3s to check if e2e passes
- Do not fail if hostname format is not abc-n
- Fix unit test and skip some e2e
- Skip TestGitSubmoduleHTTPSSupport test
- Remove breaking defer c.lock.Unlock()
- Reverting testing all k3s version
- Default sharding fix
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* fixes related to code review: renaming structure param, moving db initialisation
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Code review
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Set default shard to 0
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Set different default value for Sts and Deployment mode
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Expose ClusterShardingCache
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Removing use of argoDB.db for DistributionFunction
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Update generated documentation
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Fix comment about NoShardingDistributionFunction and NoShardingAlgorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
---------
Signed-off-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Co-authored-by: Alexandre Gaudreault <alexandre.gaudreault@logmein.com>
* feat: PostDelete hooks support
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
---------
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* fix(controller): log failed attempts to update operation state
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* new package name
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* Update controller/appcontroller_test.go
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix: trigger refresh on changed ignoreDifferences
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* make the tests mean things
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix: retain order of revisions for multi source apps (#14108)
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* fix: retain revision for multi source app with ref-repos
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
* calculate commitSHA before quitting manifest generation
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Lukas Wöhrl <lukas.woehrl@plentymarkets.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix: Extraction of DistributionFunction to allow passing different type of functions to filter clusters by shard
- Adding unit tests for sharding
- Refresh clusters list on DistributionFunction call
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
* fix: Incorrect conversion of an integer with architecture-dependent bit size from [strconv.Atoi](1) to a lower bit size type uint32 without an upper bound check.
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Added config to switch to round-robin sharding
Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Documenting sharding more, adding shuffling tests (skipped), re-enable sharding algo env var
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* Allow configuration through argocd-cmd-params-cm configMap and key: controller.sharding.algorithm
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
* De-duplicate code, remove reflection for default case, shorten distribution methods name, ran codegen on manifests
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
---------
Signed-off-by: Akram Ben Aissi <akram.benaissi@gmail.com>
Signed-off-by: ishitasequeira <ishiseq29@gmail.com>
Signed-off-by: Raghavi Shirur <rshirur@redhat.com>
Co-authored-by: Raghavi Shirur <raghaviss11@gmail.com>
Signed-off-by: Kevin Huber <kevin.huber@hotmail.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix: update managed namespace metadata
This commit fixes an issue where a namespace does not get updated
unless a sync is performed. Since the `managedNamespaceMetadata` is not
a part of the Application Git state, we need a way to force a sync once
the metadata has changed. In order to do that, we need to add state
to compare with.
Once a sync is performed, the `ManagedNamespaceMetadata` gets copied
to `SyncResult`, which will then be compared with on subsequent syncs.
If there's a mismatch between
`app.Spec.SyncPolicy.ManagedNamespaceMetadata` and
`app.Status.OperationState.SyncResult.ManagedNamespaceMetadata` we mark
the Application as `OutOfSync`.
Fixes#12661.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix: nil check
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix: allow empty apps to be updated
If an app is empty but still differs in terms of
`managedNamespaceMetadata`, it should still be kept up to date.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* test: add unit tests in appcontroller
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* fix: rebase
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* refactor: extract method
Consolidate checks to `app.HasChangedManagedNamespaceMetadata()`
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* chore: make codegen
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
---------
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
At the time of making this commit, the package `github.com/ghodss/yaml`
is no longer actively maintained.
`sigs.k8s.io/yaml` is a permanent fork of `ghodss/yaml` and is actively
maintained by Kubernetes SIG.
Signed-off-by: Eng Zer Jun <engzerjun@gmail.com>
* fix: evaluate all possible refresh reasons for multi-source apps (#12379)
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* remove redundant parentheses
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* tests
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* don't auto-sync, it makes tests flaky
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* auto-sync because sync CLI doesn't work for multi-source apps
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* don't require out-of-sync - app may sync quickly
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* timeout 60
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix timeout
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
---------
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: ChangZhuo Chen (陳昌倬) <czchen@czchen.org>
add test
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
better comment
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: CI <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix: application stuck in infinite reconciliation loop if using wrong project
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* add missing unit test
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
This commit adds a new flag, `permitOnlyProjectScopedClusters`, which
prevents any application from syncing to clusters which are not a part
of the same project. Fixes#10220.
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
Signed-off-by: Blake Pettersson <blake.pettersson@gmail.com>
* chore: infer managed resources health from redis instead of storing it in CRD
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
* apply reviewer notes
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>
Signed-off-by: Alexander Matyushentsev <AMatyushentsev@gmail.com>