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

Helm Parameters with no specified force_string show are replaced whenever another parameter changes. #383

Open
ahublersos opened this issue Mar 29, 2024 · 1 comment
Labels
bug Something isn't working help wanted Community help wanted! on-hold Issues or Pull Requests with this label will never be considered stale Stale

Comments

@ahublersos
Copy link
Contributor

Adding Helm Parameters without specifying a value for force_string use false as a default. This does not show any diff until there is another change any parameter is changed or added, in which case the terraform plan shows all parameters using the default value for force_string are being removed and re-added without force_string.

If a parameter is explicitly configured with a value for force_string, the plan does not show it being removed.

Terraform Version, ArgoCD Provider Version and ArgoCD Version

Terraform version: 1.7.1
ArgoCD provider version: 6.0.3
ArgoCD version: 2.9.2

Affected Resource(s)

Terraform Configuration Files

resource "argocd_application_set" "helm_guestbook" {
  metadata {
    name = "helm-guestbook"
  }

  spec {
    generator {
      clusters {
        selector {
          match_expressions {
            key      = "envStage"
            operator = "In"
            values   = ["dev"]
          }
        }
      }
    }

    template {
      metadata {
        name = "{{name}}-helm-guestbook"
      }

      spec {
        project = "default"

        source {
          repo_url        = "https://github.com/argoproj/argocd-example-apps.git"
          path            = "helm-guestbook"
          target_revision = "HEAD"

          helm {
            parameter {
              name  = "service.type"
              value = "LoadBalancer"
            }

            parameter {
              name  = "service.port"
              value = 80
            }
          }
        }
        destination {
          server    = "{{server}}"
          namespace = "guestbook"
        }
      }
    }
  }
}

Steps to Reproduce

  1. terraform apply the example above
  2. Change the value of the service.port parameter to 8080.
  3. terraform plan
  4. Observe output planning to delete the service.type parameter and add it back without force_string.
  5. Add force_string = false to the service.type.
  6. terraform plan
  7. Observe output no longer plans to delete the service.type parameter.

Expected Behavior

Helm parameters with no specified force_string should only be changed if that parameter's value changes.

Actual Behavior

Helm parameters with no specified force_string are changed whenever there is another change to parameters.
Example plan:

 # argocd_application_set.helm_guestbook will be updated in-place
  ~ resource "argocd_application_set" "helm_guestbook" {
        id = "helm-guestbook"

      ~ spec {
            # (1 unchanged attribute hidden)

          ~ template {
              ~ spec {
                    # (2 unchanged attributes hidden)

                  ~ source {
                        # (3 unchanged attributes hidden)

                      ~ helm {
                            # (4 unchanged attributes hidden)

                          - parameter {
                              - force_string = false -> null
                              - name         = "service.port" -> null
                              - value        = "80" -> null
                            }
                          - parameter {
                              - force_string = false -> null
                              - name         = "service.type" -> null
                              - value        = "LoadBalancer" -> null
                            }
                          + parameter {
                              + name  = "service.port"
                              + value = "8080"
                            }
                          + parameter {
                              + name  = "service.type"
                              + value = "LoadBalancer"
                            }
                        }
                    }

                    # (1 unchanged block hidden)
                }

                # (1 unchanged block hidden)
            }

            # (1 unchanged block hidden)
        }

        # (1 unchanged block hidden)
    }

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

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
@ahublersos ahublersos added the bug Something isn't working label Mar 29, 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 help wanted Community help wanted! on-hold Issues or Pull Requests with this label will never be considered stale labels Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Community help wanted! on-hold Issues or Pull Requests with this label will never be considered stale Stale
Projects
None yet
Development

No branches or pull requests

2 participants