Skip to content

Commit 2bd2488

Browse files
pasha-codefreshpasha
andauthored
feat: Enable SkipDryRunOnMissingResource sync option on Application level (#22679)
Co-authored-by: pasha <[email protected]>
1 parent 86fa92d commit 2bd2488

File tree

5 files changed

+17
-3
lines changed

5 files changed

+17
-3
lines changed

controller/sync.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,6 +371,7 @@ func (m *appStateManager) SyncAppState(app *v1alpha1.Application, state *v1alpha
371371
sync.WithServerSideApply(syncOp.SyncOptions.HasOption(common.SyncOptionServerSideApply)),
372372
sync.WithServerSideApplyManager(cdcommon.ArgoCDSSAManager),
373373
sync.WithPruneConfirmed(app.IsDeletionConfirmed(state.StartedAt.Time)),
374+
sync.WithSkipDryRunOnMissingResource(syncOp.SyncOptions.HasOption(common.SyncOptionSkipDryRunOnMissingResource)),
374375
}
375376

376377
if syncOp.SyncOptions.HasOption("CreateNamespace=true") {

docs/operator-manual/application.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@ spec:
236236
- PruneLast=true # Allow the ability for resource pruning to happen as a final, implicit wave of a sync operation
237237
- RespectIgnoreDifferences=true # When syncing changes, respect fields ignored by the ignoreDifferences configuration
238238
- ApplyOutOfSyncOnly=true # Only sync out-of-sync resources, rather than applying every object in the application
239+
- SkipDryRunOnMissingResource=true # Allow skip dry run on missing resource
239240
managedNamespaceMetadata: # Sets the metadata for the application namespace. Only valid if CreateNamespace=true (see above), otherwise it's a no-op.
240241
labels: # The labels to set on the application namespace
241242
any: label

docs/user-guide/sync-options.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,18 @@ metadata:
6767

6868
The dry run will still be executed if the CRD is already present in the cluster.
6969

70+
It is also possible to skip dry run on missing resource for all application resources. You can set the `SkipDryRunOnMissingResource=true`
71+
sync option to skip dry run on missing resource
72+
73+
```yaml
74+
apiVersion: argoproj.io/v1alpha1
75+
kind: Application
76+
spec:
77+
syncPolicy:
78+
syncOptions:
79+
- SkipDryRunOnMissingResource=true
80+
```
81+
7082
## No Resource Deletion
7183

7284
For certain resources you might want to retain them even after your application is deleted, for eg. Persistent Volume Claims.

go.mod

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ require (
1212
github.com/Masterminds/sprig/v3 v3.3.0
1313
github.com/TomOnTime/utfutil v1.0.0
1414
github.com/alicebob/miniredis/v2 v2.34.0
15-
github.com/argoproj/gitops-engine v0.7.1-0.20250314164314-7258614f5041
15+
github.com/argoproj/gitops-engine v0.7.1-0.20250420064138-d65e9d92277d
1616
github.com/argoproj/notifications-engine v0.4.1-0.20250309174002-87bf0576a872
1717
github.com/argoproj/pkg/v2 v2.0.1
1818
github.com/aws/aws-sdk-go v1.55.6

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be h1:9AeTilPcZAjCFI
114114
github.com/anmitsu/go-shlex v0.0.0-20200514113438-38f4b401e2be/go.mod h1:ySMOLuWl6zY27l47sB3qLNK6tF2fkHG55UZxx8oIVo4=
115115
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
116116
github.com/appscode/go v0.0.0-20191119085241-0887d8ec2ecc/go.mod h1:OawnOmAL4ZX3YaPdN+8HTNwBveT1jMsqP74moa9XUbE=
117-
github.com/argoproj/gitops-engine v0.7.1-0.20250314164314-7258614f5041 h1:2QuxuGZ7ZLokBqmwr02MHhI2N3ffShms/IxSbvaFtVM=
118-
github.com/argoproj/gitops-engine v0.7.1-0.20250314164314-7258614f5041/go.mod h1:4KL2HCRSGA/yLM8nOCcv+NbFsYohxmT9Lb47kWFhWYw=
117+
github.com/argoproj/gitops-engine v0.7.1-0.20250420064138-d65e9d92277d h1:NbaCC4ZX8aBB1gGByMf8CcSgL9ACwLSbXGKBl80XSa4=
118+
github.com/argoproj/gitops-engine v0.7.1-0.20250420064138-d65e9d92277d/go.mod h1:8bIs7jN5U7iKEWU4fMzZfsYWa8ere+iU1rcTiwAtL3A=
119119
github.com/argoproj/notifications-engine v0.4.1-0.20250309174002-87bf0576a872 h1:ADGAdyN9ty0+RmTT/yn+xV9vwkqvLn9O1ccqeP0Zeas=
120120
github.com/argoproj/notifications-engine v0.4.1-0.20250309174002-87bf0576a872/go.mod h1:d1RazGXWvKRFv9//rg4MRRR7rbvbE7XLgTSMT5fITTE=
121121
github.com/argoproj/pkg/v2 v2.0.1 h1:O/gCETzB/3+/hyFL/7d/VM/6pSOIRWIiBOTb2xqAHvc=

0 commit comments

Comments
 (0)