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

Feature request: Improved diffs #390

Open
cpboyd opened this issue May 3, 2024 · 1 comment
Open

Feature request: Improved diffs #390

cpboyd opened this issue May 3, 2024 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers Stale

Comments

@cpboyd
Copy link

cpboyd commented May 3, 2024

Description

Currently, it seems like any time certain blocks are added/removed (e.g. destination {} on argocd_project) then it lists all blocks as being removed and re-added.

With ArgoCD projects that have several destinations specified, this makes it very difficult to track what the actual changes are:

          - destination {
              - namespace = "api" -> null
              - server    = "https://server-1" -> null
            }
          - destination {
              - namespace = "api" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "api" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "api" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "argo-*" -> null
              - server    = "https://server-1" -> null
            }
          - destination {
              - namespace = "argo-*" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "argo-*" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "argo-*" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "pub" -> null
              - server    = "https://server-1" -> null
            }
          - destination {
              - namespace = "pub" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "pub" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "pub" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "sec" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "sec" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "sec" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "test" -> null
              - server    = "https://server-1" -> null
            }
          - destination {
              - namespace = "test" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "test" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "test" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "test" -> null
              - server    = "https://kubernetes.default.svc" -> null
            }
          - destination {
              - namespace = "ui" -> null
              - server    = "https://server-1" -> null
            }
          - destination {
              - namespace = "ui" -> null
              - server    = "https://server-2" -> null
            }
          - destination {
              - namespace = "ui" -> null
              - server    = "https://server-3" -> null
            }
          - destination {
              - namespace = "ui" -> null
              - server    = "https://server-4" -> null
            }
          - destination {
              - namespace = "sec" -> null
              - server    = "https://server-1" -> null
            }
          + destination {
              + namespace = "map"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "map"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "map"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "map"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "api"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "api"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "api"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "api"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "argo-*"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "argo-*"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "argo-*"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "argo-*"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "pub"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "pub"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "pub"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "pub"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "sec"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "sec"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "sec"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "sec"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "test"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "test"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "test"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "test"
              + server    = "https://server-4"
            }
          + destination {
              + namespace = "test"
              + server    = "https://kubernetes.default.svc"
            }
          + destination {
              + namespace = "ui"
              + server    = "https://server-1"
            }
          + destination {
              + namespace = "ui"
              + server    = "https://server-2"
            }
          + destination {
              + namespace = "ui"
              + server    = "https://server-3"
            }
          + destination {
              + namespace = "ui"
              + server    = "https://server-4"
            }

Potential Terraform Configuration

I know that other modules have changed from list to map for easier diffs. I'm not sure if maybe using blocks (instead of a map or some other structure) for this is causing the issue here.

Maybe there's also something with how the provider is rendering the pending changes that could be adjusted, like putting the new stuff last (since in this specific example, the only addition is the namespace = "map")

References

hashicorp/terraform#21901

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment
@cpboyd cpboyd added the enhancement New feature or request label May 3, 2024
Copy link

github-actions bot commented Oct 3, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Oct 3, 2024
@mkilchhofer mkilchhofer added the good first issue Good for newcomers label Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers Stale
Projects
None yet
Development

No branches or pull requests

2 participants