-
Notifications
You must be signed in to change notification settings - Fork 90
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
Added support for managedFieldsManagers and Helm templating version #400
Merged
onematchfox
merged 9 commits into
argoproj-labs:master
from
tonedefdev:add-managed-fields-managers-helm-version
Aug 20, 2024
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
d279eda
Added support for the managed_fields_managers to specify ignoring dif…
tonedefdev f17b87e
Updated documentation
tonedefdev adadffb
Ensured that helm version and managed fields managers are flattened. …
tonedefdev f22ec1d
Included the helm version in test case
tonedefdev e14ca41
Fixed typo in test case ref to managed_fields_managers
tonedefdev 66d010d
Fixed issues with test cases. Updated documentation withe the two acc…
tonedefdev c38f0fb
Fixed helm version and managed fields managers attr checks
tonedefdev 369d644
Included json pointers in ignore difference to fix issues with state …
tonedefdev 09e7823
Ignore validate on state checks. Fixed bad formatting, thanks VSCode.…
tonedefdev 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 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 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 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 |
---|---|---|
|
@@ -311,6 +311,10 @@ func expandApplicationSourceHelm(in []interface{}) *application.ApplicationSourc | |
result.SkipCrds = v.(bool) | ||
} | ||
|
||
if v, ok := a["version"]; ok { | ||
result.Version = v.(string) | ||
} | ||
|
||
return result | ||
} | ||
|
||
|
@@ -451,6 +455,13 @@ func expandApplicationIgnoreDifferences(ids []interface{}) (result []application | |
} | ||
} | ||
|
||
if v, ok := id["managed_fields_managers"]; ok { | ||
managedFieldsManagers := v.(*schema.Set).List() | ||
for _, fieldsManager := range managedFieldsManagers { | ||
elem.ManagedFieldsManagers = append(elem.ManagedFieldsManagers, fieldsManager.(string)) | ||
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. Same issue here. See flattenApplicationIgnoreDifferences |
||
} | ||
} | ||
|
||
result = append(result, elem) | ||
} | ||
|
||
|
@@ -645,12 +656,13 @@ func flattenApplicationInfo(infos []application.Info) (result []map[string]strin | |
func flattenApplicationIgnoreDifferences(ids []application.ResourceIgnoreDifferences) (result []map[string]interface{}) { | ||
for _, id := range ids { | ||
result = append(result, map[string]interface{}{ | ||
"group": id.Group, | ||
"kind": id.Kind, | ||
"name": id.Name, | ||
"namespace": id.Namespace, | ||
"json_pointers": id.JSONPointers, | ||
"jq_path_expressions": id.JQPathExpressions, | ||
"group": id.Group, | ||
"kind": id.Kind, | ||
"name": id.Name, | ||
"namespace": id.Namespace, | ||
"json_pointers": id.JSONPointers, | ||
"jq_path_expressions": id.JQPathExpressions, | ||
"managed_fields_managers": id.ManagedFieldsManagers, | ||
}) | ||
} | ||
|
||
|
@@ -788,6 +800,7 @@ func flattenApplicationSourceHelm(as []*application.ApplicationSourceHelm) (resu | |
"values": a.Values, | ||
"pass_credentials": a.PassCredentials, | ||
"ignore_missing_value_files": a.IgnoreMissingValueFiles, | ||
"version": a.Version, | ||
}) | ||
} | ||
} | ||
|
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
This code ensures that the version is correctly set when creating the application in ArgoCD however, you are missing the oppositye side of this code which ensures that the Terraform state is updated to reflect the current state of the application in ArgoCD. See flattenApplicationSourceHelm.