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

Support for job.group.consul block in nomad_job (non-hcl2) #241

Closed
saltxwater opened this issue Jul 27, 2021 · 2 comments
Closed

Support for job.group.consul block in nomad_job (non-hcl2) #241

saltxwater opened this issue Jul 27, 2021 · 2 comments

Comments

@saltxwater
Copy link

Terraform Version

Terraform v0.14.6

  • provider registry.terraform.io/hashicorp/nomad v1.4.15

Nomad Version

1.1.2+ent

Provider Configuration

Which values are you setting in the provider configuration?

provider "nomad" { }

Environment Variables

NOMAD_ADDR and NOMAD_TOKEN are set appropriately

Affected Resource(s)

  • nomad_job

Terraform Configuration Files

resource "nomad_job" "test" {
  jobspec = <<-EOT
   ##..
  group "test" {
    consul {
      namespace = "default"
    }
  }
  # ..
  EOT
}

Expected Behavior

Job should be parsed correctly and submitted to Nomad for execution

Actual Behavior

Error: error parsing jobspec: error parsing 'job': 1 error occurred:
        * group: 'test' -> invalid key: consul

Steps to Reproduce

  1. terraform plan

Important Factoids

This is a duplicate of the fixed issue:
#220
However with hcl2 not-enabled.
The parser goes through a different code path when hcl2 is not enabled and I don't think this parser has been fixed:
https://github.com/hashicorp/terraform-provider-nomad/blob/main/nomad/resource_job.go#L738

References

#220

@jrasell
Copy link
Member

jrasell commented Jul 27, 2021

Hi @saltxwater and thanks for taking the time to fill this detailed issue. This is related to the fact that Nomad was not updating the hclv1 parser to include new functionality until recently, where we decided to change approach and keep the hclv1 and hclv2 parser harmonised. This work was conducted within hashicorp/nomad#10931 and is pending release. I will work on updating the dependancy to fix this issue.

@lgfa29
Copy link
Contributor

lgfa29 commented Nov 24, 2021

Closed by #256

@lgfa29 lgfa29 closed this as completed Nov 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants