-
Notifications
You must be signed in to change notification settings - Fork 101
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
TF continually wants to update nomad_job resource between plan/apply #290
Comments
Hi @kian 👋 I have not been able to reproduce this issue. Could test with a smaller job and see if the problem still happens? |
I'm having a similar issue, but with periodic jobs -some thoughts that I had to be the cause -
Here is an example job:
Here is the error:
We are using Nomad 1.4.1 |
Hi, I have the same issue. ~ resource "nomad_job" "this" {
~ allocation_ids = [
- "4992e7e2-9b6f-adce-a2e4-fd007d042eaf",
- "09c0473b-9adf-ae2b-85e4-724dfdc324cb",
- "ed1a45ed-f3a3-e722-1fe5-20ac966047f3",
- "31bbd497-401f-9cb9-986d-1e31860810b3",
- "96a4f90c-b675-265a-ee23-208b9d476a14",
- "2b63d096-ea89-bddc-50d6-151d02b187aa",
- "65864468-b42c-8bb4-f802-7a0bf7edc221",
- "880f23ed-8000-92e0-beee-11127f54e8e0",
- "d138bed9-1cfa-1030-8a51-34162ccda3e9",
] -> (known after apply)
id = "cassandra-main"
~ modify_index = "1572279" -> (known after apply)
name = "cassandra-main"
# (9 unchanged attributes hidden)
# (1 unchanged block hidden)
} |
Hi @lgfa29: |
I have a similar behaviour, but when adding comments to the jobspec file.
It looks like the comments are ignored by nomad and thus nomad says "nothing changed". But terraform would need to update the state with the comments/ignored lines by nomad. |
Thanks for the all the extra info everyone. The analysis from @the-nando, @stevecn, and @ttaghavi about the space or var default changes seems like the root cause. #356 uses a semantic jobspec diff to prevent problems like these. I'm also planning on deprecating the |
Terraform Version
Terraform v1.0.0
Nomad provider version 1.4.17
Nomad Version
1.1.0
Provider Configuration
Which values are you setting in the provider configuration?
Environment Variables
No
Affected Resource(s)
Please list the resources as a list, for example:
Terraform Configuration Files
Terraform:
Job spec template:
Expected Behavior
terraform plan
andterraform apply
do not continually report a difference in nomad_job attributes such as allocation_ids and region.Actual Behavior
terraform plan
followed byterraform apply
constantly show a change in the nomad job resource.first plan, followed by apply:
after applying, second plan:
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform apply && terraform apply
The text was updated successfully, but these errors were encountered: