-
Notifications
You must be signed in to change notification settings - Fork 371
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
Release 2.10.0 appears to be destructive and not backwards compatible #1285
Comments
I don't see any disruptive changes introduced in Thanks. |
Sure! @arybolovlev Terraform v1.2.7 When I run my argocd module with the helm provider 2.9.0 and no other changes I see this in my plan
When I just switch the provider to 2.10.0, I see tons of changes on all the helm releases we have in this module, here is just a snippet as its like hundreds of lines
The actual module code for like the helm release dex-pdb looks like this
It is just using a simple helm chart to install a PDB, nothing fancy, but I think it may be changing because it uses the argocd output as a dependency and that is changing so it might be forcing this to change The argocd helm release looks like this
Its using argos helm chart passing in all the values overrides we do, some have secret values in them I also just tried this on another module we have for another helm release and it does not show anything destructive, but that one doesn't use secrets, maybe it has to do with this sensitive data stuff perhaps? I am really scratching my head, happy to provide more things if you need it let me know |
It appears like its recomputing the metadata on this, but nothing has changed. The 2.10.0 release notes are about recomputing the metadata, and that is what this is doing, but this is super destructive for us, its going to destroy argo and recreate it, which is not something we can do. I don't understand why its recomputing it though if nothing has changed on our side |
Thank you for the detailed explanation and for sharing the code snippets. The issue you encounter is indeed related to the changes introduced in In your In your case, the way to address the issue would be to change the referred attribute from resource "helm_release" "dex-pdb" {
...
namespace = helm_release.argocd.namespace
...
} In this case, you still keep dependency and these two resources will be applied sequentially. I hope it helps. Thanks! |
@arybolovlev So for the argocd helm release issue, the problem is the values is NOT changing. We have a perpetual diff for some reason because of sensitive data. SO nothing is actually really changing. So this actually makes the perpetual diff even worse if we go to 2.10.0, because its going to destroy/recreate the release. Why does helm think something is changing when it isn't? Is that an entirely separate bug then? also with 2.10.0, it prints out in plain text all the secret /sensitive information, when it didn't prior. I think that should warrant a release note too perhaps, because if we ran this in prod, we would have to then go and rotate all our secrets likely because they would have been plain text dumped out, that seems like a bug as well? |
If I understand you right, you refer to the following change:
I need additional context here. From your code, I understand that I have tested it with the following code and don't observe perpetual diff. I only get diff when update variables: variable "namespace" {
default = "this"
}
variable "replicas" {
default = 3
sensitive = true
}
variable "autoscaling" {
default = true
}
locals {
chart_variables = {
"server": {
"replicas": var.replicas,
"autoscaling": {
"enabled": var.autoscaling
}
}
}
}
resource "helm_release" "argocd" {
name = "argocd"
create_namespace = true
repository = "https://argoproj.github.io/argo-helm"
chart = "argo-cd"
version = "v5.51.0"
namespace = var.namespace
values = [
yamlencode(local.chart_variables)
]
} |
Let me check on the local variable in use and get you some details here! |
@arybolovlev
I can gist the entire thing if you are interested, but there are no datas, and the only resource we use is a security group. We do a lot of templatefile/ file calls and a yamldecode on a file. It has been doing this perpetual diff for a while now, I think honestly when we made the variables sensitive perhaps |
Thanks for sharing this. If there are no dynamic values, then I guess we have only one option left. There is a difference between I understand this is a production environment, so I would advise you to make a copy of your code and play with it locally in a different folder. You can copy only variables that you use $ terraform console
> yamlencode(local.chart_variables)
<<EOT
"rbac": |
create: true
"server":
"autoscaling":
"enabled": true
"replicas": 3
EOT Or, you can add an output and run output "debug" {
value = yamlencode(local.chart_variables)
} $ terraform plan
...
Changes to Outputs:
+ debug = <<-EOT
"rbac": |
create: true
"server":
"autoscaling":
"enabled": true
"replicas": 3
EOT The goal here is to get a YAML document that gets rendered by
Then use $ echo "\"rbac\": |\n create: true\n\"server\":\n \"autoscaling\":\n \"enabled\": true\n \"replicas\": 3\n"
"rbac": |
create: true
"server":
"autoscaling":
"enabled": true
"replicas": 3 If you compare outputs, it should be a difference between the output you render from the copy of your code and the actual state. It might be invisible or hard to recognize symbols, so use a tool to get a diff. Maybe there is an easy way to get diff, but this is the first one that came to my mind for this case. |
Thanks ill look into this to see what it says, its just so odd that it thinks there is a change when there isn't |
Ok I was able to run this and compare in intelij some things I noticed were
In the state the variables like
I am not sold though these are the problem |
I opened this ticket here #1295 for the perpetual diff issue |
after solving our perpetual diff issue and moving sensitive values to the set_sensitive block we no longer see an issue here |
We were looking to upgrade to the latest provider, but noticed in doing so with the 2.10.0 release and above all the plans appear to be very destructive to helm resources already in production
When updating our provider to 2.10.0, we see plans that show every helm release needs to be replaced. The Release notes https://github.com/hashicorp/terraform-provider-helm/releases/tag/v2.10.0 do not mention anything of the sort.
Is this intentional? I cannot imagine we are the only one that would be impacted here and this prevents us from ever being able to upgrade. Is there a migration path so its not destructive? Is there more details on what is going to happen perhaps?
This is what the plan now shows for example
The text was updated successfully, but these errors were encountered: