Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync option #1

Open
wants to merge 33 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
519a55f
adding new install
Feb 6, 2024
dc821d9
adding new type and println
Feb 7, 2024
5deff51
docs(proposal): decoupling app sync from control plane user w/ impers…
anandf Feb 6, 2024
3dff962
chore(ci): run ci checks conditionally (#16982)
blakepettersson Feb 6, 2024
bf73b95
fix(ui): Change path to "root" when path is root directory (#14949)
eshwarhs Feb 6, 2024
1b22439
typo `registires` -> `registries` (#17099)
adam-huganir Feb 6, 2024
7b6eabe
Updated otelgrpc to remediate CVE found by JFrog Xray (#17084)
yitzhtal Feb 6, 2024
c35fc2c
docs(webhook): use real cm name instead of placeholder (#17002)
dosmanak Feb 6, 2024
949068d
docs: Update Okta OIDC SSO docs (#13811)
jcourteau Feb 6, 2024
ba1bfb8
Add a description for using contour httpproxy CRD (#14614)
borisssmidtCET Feb 6, 2024
3f1fbb9
fix: ci failures (#17107)
gdsoumya Feb 6, 2024
5ed8f4a
chore(deps): bump library/golang from 1.21.3 to 1.22.0 in /test/remot…
dependabot[bot] Feb 7, 2024
04b0373
chore(deps-dev): bump yarn from 1.22.10 to 1.22.13 in /ui-test (#17092)
dependabot[bot] Feb 7, 2024
dd915d7
chore(deps): bump library/redis from 7.0.11 to 7.2.4 in /test/contain…
dependabot[bot] Feb 7, 2024
55e85c8
chore(deps-dev): bump yarn from 1.22.10 to 1.22.21 in /ui (#17096)
dependabot[bot] Feb 7, 2024
ca4590a
fix the typo (#17116)
soravkumarsharma Feb 7, 2024
551481c
chore(deps): bump library/node from 20.6.1 to 21.6.1 (#17053)
dependabot[bot] Feb 7, 2024
9b888cf
chore(deps): bump library/node from 20.7.0 to 21.6.1 (#17065)
fengshunli Feb 7, 2024
773a681
fix(kustomize): set build dir (#15057) #16229 #16652 (#16653)
prune998 Feb 7, 2024
0b79445
chore(ci): tweak backend filters (#17134)
blakepettersson Feb 7, 2024
b3d056d
docs: fix error in toolchain setup (#17154)
agaudreault Feb 9, 2024
af562a7
chore(dex): 2.37.0 to 2.38.0 (#17157)
ashutosh16 Feb 9, 2024
391ad13
feat: Add support for passing Redis Sentinel username(ACL) and passwo…
shlomitubul Feb 11, 2024
33ffc81
fix: stop initializing deployment informer if dynamic sharding is dis…
gdsoumya Feb 11, 2024
db85659
feat: query escape function for notifications (#16343)
janschumann Feb 12, 2024
ed54eae
adding the basement of the AppProjectfonc
Feb 13, 2024
7c25257
removing some log in sync.go file
Feb 13, 2024
de27fc5
Update triggers doc to fix typo (#17185)
dgrizzanti Feb 13, 2024
d486ac7
docs: fixes Template.md targetRevision typo (#17190)
chidambaram27 Feb 13, 2024
4ff2b99
docs: Private-helm-repo section target added to helm.md (#16697)
surajyadav1108 Feb 13, 2024
01cb830
fix: infer correct shard in statefulset setup (#17124, #17016) (#17167)
woehrl01 Feb 13, 2024
5958c3b
Merge remote-tracking branch 'fork/master' into syncOption
Feb 14, 2024
f9385cd
adding new doc for project CRD
Feb 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion controller/sync.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,13 @@ func (m *appStateManager) SyncAppState(appProject *v1alpha1.AppProject, app *v1a
var source v1alpha1.ApplicationSource
var sources []v1alpha1.ApplicationSource
revisions := make([]string, 0)
projectSyncOp := appProject.Spec.SyncPolicy.SyncOptions
var projectSyncOp v1alpha1.SyncOptions

if appProject.Spec.SyncPolicy != nil {
projectSyncOp = appProject.Spec.SyncPolicy.SyncOptions
} else {
projectSyncOp = nil
}

if state.Operation.Sync == nil {
state.Phase = common.OperationFailed
Expand Down
30 changes: 30 additions & 0 deletions docs/operator-manual/project.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,36 @@ spec:
clusters:
- in-cluster
- cluster1

# Sync policy
syncPolicy:
automated: # automated sync by default retries failed attempts 5 times with following delays between attempts ( 5s, 10s, 20s, 40s, 80s ); retry controlled using `retry` field.
prune: true # Specifies if resources should be pruned during auto-syncing ( false by default ).
selfHeal: true # Specifies if partial app sync should be executed when resources are changed only in target Kubernetes cluster and no git change detected ( false by default ).
allowEmpty: false # Allows deleting all application resources during automatic syncing ( false by default ).
syncOptions: # Sync options which modifies sync behavior
- Validate=false # disables resource validation (equivalent to 'kubectl apply --validate=false') ( true by default ).
- CreateNamespace=true # Namespace Auto-Creation ensures that namespace specified as the application destination exists in the destination cluster.
- PrunePropagationPolicy=foreground # Supported policies are background, foreground and orphan.
- PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
- RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
- ApplyOutOfSyncOnly=true # Only sync out-of-sync resources, rather than applying every object in the application
managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
labels: # The labels to set on the application namespace
any: label
you: like
annotations: # The annotations to set on the application namespace
the: same
applies: for
annotations: on-the-namespace

# The retry feature is available since v1.7
retry:
limit: 5 # number of failed sync attempt retries; unlimited number of attempts if less than 0
backoff:
duration: 5s # the amount to back off. Default unit is seconds, but could also be a duration (e.g. "2m", "1h")
factor: 2 # a factor to multiply the base duration after each failed retry
maxDuration: 3m # the maximum amount of time allowed for the backoff strategy

# By default, apps may sync to any cluster specified under the `destinations` field, even if they are not
# scoped to this project. Set the following field to `true` to restrict apps in this cluster to only clusters
Expand Down
Loading