Skip to content

Add applications sync to application set sync policies#337

Merged
onematchfox merged 16 commits into
argoproj-labs:masterfrom
ahublersos:333_add_applications_sync_to_application_set_sync_policies
Oct 16, 2023
Merged

Add applications sync to application set sync policies#337
onematchfox merged 16 commits into
argoproj-labs:masterfrom
ahublersos:333_add_applications_sync_to_application_set_sync_policies

Conversation

@ahublersos

@ahublersos ahublersos commented Sep 15, 2023

Copy link
Copy Markdown
Contributor

Fixes #333.
Adds support for applications_sync to the application set resource.

I also nearly installed the test manifests into a live cluster by running testacc_prepare_env so I added a few safety safety nets to prevent that from happening in the future. Happy to split this out into a new PR if that's preferred.

@ahublersos ahublersos marked this pull request as ready for review September 16, 2023 14:53
@ahublersos

Copy link
Copy Markdown
Contributor Author

I don't know why the TestAccArgoCDCluster_invalidSameServer test is failing. That passed in local testing and doesn't seem related to changes in the application_set resource.

@onematchfox

Copy link
Copy Markdown
Collaborator

I don't know why the TestAccArgoCDCluster_invalidSameServer test is failing. That passed in local testing and doesn't seem related to changes in the application_set resource.

Yeah, that's just a flaky test. Everything passing now. Will try take a look at the changes a some point today/tomorrow morning.

@onematchfox onematchfox left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry for the slow feedback. Hopefully just one small change - otherwise LGTM.

Comment thread argocd/structure_application_set.go Outdated
)

func expandApplicationSet(d *schema.ResourceData, featureMultipleApplicationSourcesSupported bool) (metadata meta.ObjectMeta, spec application.ApplicationSetSpec, err error) {
func expandApplicationSet(d *schema.ResourceData, featureMultipleApplicationSourcesSupported bool, featureApplicationSetApplicationsSyncPolicy bool) (metadata meta.ObjectMeta, spec application.ApplicationSetSpec, err error) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I realise this is a bit confusing, but can you please drop this parameter (and it's usage in this file) and rather use the feature flag to implement a check on the user's provided configuration as per https://github.com/oboukili/terraform-provider-argocd/blob/d84d09101f8c1954cf613df69890a846540692b7/argocd/resource_argocd_application_set.go#L49-L51.

In essence, this is the pattern used by all other feature flags - we check the user's configuration of the Terraform resource and return an error if they try to configure something via Terraform that isn't supported by their version of ArgoCD (thereby preventing the configuration from being applied to the resulting CRUD call the provider makes). Multiple applications sources is the exception here in that we support versions that both have and do not have the feature and thus, need branching logic in what we set on the CRUD call.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Got it, thanks for the explanation! I've removed this parameter and added a feature flag check in the resource.

@github-actions

Copy link
Copy Markdown

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 Issue didn't had recent activity and will be closed soon label Oct 13, 2023
@onematchfox

Copy link
Copy Markdown
Collaborator

This isn't stale. I just need to get around to looking at the failing tests.

@github-actions github-actions Bot removed the Stale Issue didn't had recent activity and will be closed soon label Oct 14, 2023
@onematchfox onematchfox changed the title 333 add applications sync to application set sync policies Add applications sync to application set sync policies Oct 16, 2023
@onematchfox

Copy link
Copy Markdown
Collaborator

Sorry for the delay here @ahublersos and thanks for your patience!

@onematchfox onematchfox merged commit 1f84b3c into argoproj-labs:master Oct 16, 2023
@onematchfox

Copy link
Copy Markdown
Collaborator

@ahublersos can/should I go ahead and cut a new release now?

@ahublersos

Copy link
Copy Markdown
Contributor Author

@onematchfox yes, please do!

@onematchfox

Copy link
Copy Markdown
Collaborator

@onematchfox yes, please do!

Sorry... more delays. Our release pipeline is broken. Will try upgrade/fix this weekend.

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 ApplicationSet level Application modification Policies

2 participants