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

fix: constant orphaned changes if not specified & crash #153

Merged
merged 3 commits into from
Mar 31, 2022

Conversation

MrLuje
Copy link
Contributor

@MrLuje MrLuje commented Mar 20, 2022

Resolves #105 & #104

To be on par with the API surface of Argo CD, "orphaned resources monitoring" will be only enabled if it is explicitly declared. Monitoring enabled because of the previous default behavior will be detected as a removal on next apply.

This is a BREAKING CHANGE with the current version :

"Orphaned resources" block specified Current version This PR
Yes Enables monitoring Enables monitoring
No Enables monitoring Disables monitoring

BREAKING CHANGE: To be on par with the API surface of Argo CD, "orphaned resources monitoring" will be only enabled if it is explicitly declared. Monitoring enabled because of the previous default behavior will be detected as a removal on next apply.
Copy link
Collaborator

@oboukili oboukili left a comment

Choose a reason for hiding this comment

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

Good catch!

@MrLuje
Copy link
Contributor Author

MrLuje commented Mar 21, 2022

I took a look at the failing test TestAccArgoCDProject_tokensCoexistence which has ExpectNonEmptyPlan: true. I suppose the non-empty plan was due to the orphaned_resources bug and not the behavior being tested.

Here is the plan generated on master :

/terraform-provider-argocd/argocd/resource_argocd_project_test.go:72: Step 1/1, expected an error with pattern, no match on: After applying this test step, the plan was not empty.
        stdout:


        Terraform used the selected providers to generate the following execution
        plan. Resource actions are indicated with the following symbols:
          ~ update in-place

        Terraform will perform the following actions:

          # argocd_project.coexistence will be updated in-place
          ~ resource "argocd_project" "coexistence" {
                id = "test-acc-zozru04kea"

              ~ metadata {
                  + annotations      = {}
                  + labels           = {}
                    name             = "test-acc-zozru04kea"
                    # (4 unchanged attributes hidden)
                }

              ~ spec {
                  + signature_keys = []
                    # (2 unchanged attributes hidden)


                  - orphaned_resources {
                    }

                  ~ role {
                      + groups   = []
                        name     = "testrole"
                        # (1 unchanged attribute hidden)
                    }
                    # (1 unchanged block hidden)
                }
            }

        Plan: 0 to add, 1 to change, 0 to destroy.

If this is ok with you, I'll remove the ExpectNonEmptyPlan from this test

@oboukili
Copy link
Collaborator

Hi, ah yes good catch again! Please go ahead!

@oboukili oboukili merged commit f819c37 into argoproj-labs:master Mar 31, 2022
@MrLuje MrLuje deleted the bugfix/orphaned branch April 10, 2022 17:48
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.

Orphaned resources in projects cause constant change.
2 participants