-
Notifications
You must be signed in to change notification settings - Fork 7k
docs: Correct ApplicationSet (spec.preservedFields) #20206
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
Merged
crenshaw-dev
merged 7 commits into
argoproj:master
from
jyoungs:fix_docs_preservedFields
Oct 4, 2024
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
89c4725
Fix docs
jyoungs ed01bf3
Merge remote-tracking branch 'upstream/master' into fix_docs_preserve…
jyoungs 1d88021
Remove another errant block; improved comments
jyoungs 68510f8
Actually removed the errant block
jyoungs ec2afaa
More doc fixes
jyoungs 67e4a60
More spec fixes + USERS
jyoungs dcdc289
Merge branch 'master' into fix_docs_preservedFields
jyoungs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -3,16 +3,6 @@ kind: ApplicationSet | |||||
| metadata: | ||||||
| name: test-hello-world-appset | ||||||
| namespace: argocd | ||||||
| # To preserve this annotation and label we can use the preservedFields property | ||||||
| preservedFields: | ||||||
| # This annotation and label exists only on this Application, and not in | ||||||
| # the parent ApplicationSet template: | ||||||
| # ignoreApplicationDifferences is the preferred way to accomplish this now. | ||||||
| annotations: | ||||||
| my-custom-annotation: some-value | ||||||
| labels: | ||||||
| my-custom-label: some-value | ||||||
|
|
||||||
| spec: | ||||||
| generators: | ||||||
|
|
||||||
|
|
@@ -168,29 +158,17 @@ spec: | |||||
| applicationsSync: create-only | ||||||
|
|
||||||
| # Prevents ApplicationSet controller from deleting Applications. Update is allowed | ||||||
| # applicationsSync: create-update | ||||||
| # applicationsSync: create-update | ||||||
|
|
||||||
| # Prevents ApplicationSet controller from modifying Applications. Delete is allowed. | ||||||
| # applicationsSync: create-delete | ||||||
| # applicationsSync: create-delete | ||||||
|
|
||||||
| syncOptions: | ||||||
| - CreateNamespace=true | ||||||
| # Prevent an Application's child resources from being deleted, when the parent Application is deleted | ||||||
| preserveResourcesOnDeletion: true | ||||||
|
|
||||||
| # which fields of the ApplicationSet should be ignored when comparing Applications. | ||||||
| ignoreApplicationDifferences: | ||||||
| - jsonPointers: | ||||||
| - /spec/source/targetRevision | ||||||
| - name: some-app | ||||||
| jqExpressions: | ||||||
| - .spec.source.helm.values | ||||||
|
|
||||||
| strategy: | ||||||
| # This field lets you define fields which should be ignored when applying Application resources. This is helpful if you | ||||||
| # want to use ApplicationSets to create apps, but also want to allow users to modify those apps without having their | ||||||
| # changes overwritten by the ApplicationSet. | ||||||
| # This update strategy allows you to group Applications by labels present on the generated Application resources | ||||||
| # The RollingSync update strategy allows you to group Applications by labels present on the generated Application resources | ||||||
| # See documentation for "Progressive Syncs" | ||||||
| type: RollingSync | ||||||
| rollingSync: | ||||||
| steps: | ||||||
|
|
@@ -214,6 +192,13 @@ spec: | |||||
| - env-prod | ||||||
| maxUpdate: 10% # maxUpdate supports both integer and percentage string values (rounds down, but floored at 1 Application for >0%) | ||||||
|
|
||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
No harm adding this comment too, WDYT?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't really think this comment adds anything of value, but I did improve the comments here a bit. |
||||||
| # Define annotations and labels of the Application that this ApplicationSet will ignore | ||||||
| # ignoreApplicationDifferences is the preferred way to accomplish this now. | ||||||
| preservedFields: | ||||||
| annotations: [ some-annotation-key ] | ||||||
| labels: [ some-label-key ] | ||||||
|
|
||||||
| # Define fields of the that should be ignored when comparing Applications | ||||||
| ignoreApplicationDifferences: | ||||||
| - jsonPointers: | ||||||
| - /spec/source/targetRevision | ||||||
|
|
@@ -311,4 +296,4 @@ spec: | |||||
| operator: In | ||||||
| values: | ||||||
| - https://kubernetes.default.svc | ||||||
| - https://some-other-cluster | ||||||
| - https://some-other-cluster | ||||||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Validation error from this:
Note:
ignoreApplicationDifferencesalready appears below where it actually belongsThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch, after this is cleaned up I think we'll be ready to merge.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand. It is cleaned up (exists where it should below and not here). WDYM?