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

Service Check stanza should support HTTP body #10084

Closed
manveru opened this issue Feb 24, 2021 · 4 comments · Fixed by #10186
Closed

Service Check stanza should support HTTP body #10084

manveru opened this issue Feb 24, 2021 · 4 comments · Fixed by #10186
Assignees
Labels
good first issue stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul type/enhancement
Milestone

Comments

@manveru
Copy link
Contributor

manveru commented Feb 24, 2021

Nomad version

v1.0.4

Operating system and Environment details

NixOS

Issue

The job -> group -> service -> check stanza doesn't support setting a body for http checks.
This should be supported, since Consul has the corresponding option: https://www.consul.io/api/agent/check#body

Reproduction steps

❯ nomad job run -output ./hi.hcl         
Error getting job struct: Error parsing job file from ./hi.hcl:
hi.hcl:6,9-13: Unsupported argument; An argument named "body" is not expected here.

Job file (if appropriate)

job "hi" {
  group "hi" {
    service {
      check {
        type = "http"
        body = "hello"
      }
    }
  }
}
@shoenig
Copy link
Member

shoenig commented Feb 24, 2021

Thanks for the issue, @manveru! This seems reasonable. It shouldn't be difficult to add as it's mostly plumbing from jobspec to the Consul service registration API, and there's plenty of similar fields to look at.

@shoenig shoenig added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul type/enhancement labels Feb 24, 2021
@shoenig shoenig added this to Needs Triage in Nomad - Community Issues Triage via automation Feb 24, 2021
@shoenig shoenig moved this from Needs Triage to Needs Roadmapping in Nomad - Community Issues Triage Feb 24, 2021
@tgross tgross removed this from Needs Roadmapping in Nomad - Community Issues Triage Mar 4, 2021
@nick96
Copy link
Contributor

nick96 commented Mar 23, 2021

Hey! I've had a go at this in #10186. I'm a bit stuck on getting the body field to update when the job is updated. I'm guessing it's something in nomad/structs/diff.go but I can't figure out exactly what.

@tgross tgross linked a pull request Mar 24, 2021 that will close this issue
14 tasks
@tgross tgross added this to the 1.1.0 milestone Apr 13, 2021
@tgross tgross self-assigned this Apr 13, 2021
@tgross
Copy link
Member

tgross commented Apr 13, 2021

Closed by #10186 and will ship in Nomad 1.1.0.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 20, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
good first issue stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul type/enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants