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

Added support for managedFieldsManagers and Helm templating version #400

Conversation

tonedefdev
Copy link
Contributor

Closes #396

@tonedefdev tonedefdev force-pushed the add-managed-fields-managers-helm-version branch from 5c39154 to 2a149f5 Compare June 18, 2024 22:05
Copy link

github-actions bot commented Jul 3, 2024

This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jul 3, 2024
@onematchfox
Copy link
Collaborator

...

@github-actions github-actions bot removed the Stale label Jul 5, 2024
@tonedefdev
Copy link
Contributor Author

...

Anything else needed @onematchfox to get this approved?

Copy link

This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Jul 23, 2024
@onematchfox
Copy link
Collaborator

...

@github-actions github-actions bot removed the Stale label Jul 24, 2024
Copy link

github-actions bot commented Aug 7, 2024

This pr is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the Stale label Aug 7, 2024
@onematchfox onematchfox self-requested a review August 8, 2024 13:58
Copy link
Collaborator

@onematchfox onematchfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this PR and your patience in me getting to it. Please see comments inline. Also, please could you ensure that these fields are added to the tests:

@@ -311,6 +311,10 @@ func expandApplicationSourceHelm(in []interface{}) *application.ApplicationSourc
result.SkipCrds = v.(bool)
}

if v, ok := a["version"]; ok {
Copy link
Collaborator

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.

if v, ok := id["managed_fields_managers"]; ok {
managedFieldsManagers := v.(*schema.Set).List()
for _, fieldsManager := range managedFieldsManagers {
elem.ManagedFieldsManagers = append(elem.ManagedFieldsManagers, fieldsManager.(string))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

…ferences for external controllers that manage fields. Added support for adding the helm version for templating

Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
…Added test cases for helm version and managed fields managers

Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
@tonedefdev tonedefdev force-pushed the add-managed-fields-managers-helm-version branch from 66db8b8 to adadffb Compare August 8, 2024 16:42
Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
…epted values for helm version

Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
…verification in tests

Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
@github-actions github-actions bot removed the Stale label Aug 9, 2024
ignore_difference {
group = "apps"
kind = "Deployment"
json_pointers = ["/spec/replicas"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
json_pointers = ["/spec/replicas"]
json_pointers = ["/spec/replicas"]

nit: mixed tabs/spaces (not your fault these tests are painful in this regard - spaces in *.go files 🤮 )

Comment on lines 1699 to 1706
json_pointers = [
"/spec/replicas",
"/spec/template/spec/metadata/labels/somelabel",
]
managed_fields_managers = [
"some-controller-owner",
"some-other-controller-owner",
]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
json_pointers = [
"/spec/replicas",
"/spec/template/spec/metadata/labels/somelabel",
]
managed_fields_managers = [
"some-controller-owner",
"some-other-controller-owner",
]
managed_fields_managers = [
"some-controller-owner",
"some-other-controller-owner",
]

Good to check that everything works both with and without json_pointers

ResourceName: "argocd_application.ignore_differences_managed_fields_managers",
ImportState: true,
ImportStateVerify: true,
ImportStateVerifyIgnore: []string{"wait", "cascade", "status"},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ImportStateVerifyIgnore: []string{"wait", "cascade", "status"},
ImportStateVerifyIgnore: []string{"wait", "cascade", "status", "validate"},

Need to add validate in here to fix tests after #411 was merged

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if this was what I needed to fix the tests! Thank you. I was struggling to figure out where validate was coming from. When I was building the provider on local I saw no trace of this, so thanks for clearing this up!

Copy link
Collaborator

@onematchfox onematchfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple final changes please 🙏

… Removed json pointers on one of the tests

Signed-off-by: Tony Owens <anthony.owens1987@gmail.com>
@tonedefdev
Copy link
Contributor Author

Couple final changes please 🙏

@onematchfox - all tests are passing now and I made the requested changes! Hopefully we're good to merge now, but if we need more changes, I'm happy to oblige

@onematchfox onematchfox self-requested a review August 20, 2024 07:57
Copy link
Collaborator

@onematchfox onematchfox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks for your patience and cooperation.

@onematchfox onematchfox merged commit f4c64ee into argoproj-labs:master Aug 20, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for application inputs
2 participants