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

invalid update to service definition does not fail during registration #9364

Open
fredwangwang opened this issue Nov 15, 2020 · 1 comment
Open
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul theme/service-discovery type/bug

Comments

@fredwangwang
Copy link
Contributor

Nomad version

0.12.5

Operating system and Environment details

linux

Issue

Update to the service stanza with an invalid configuration does not fail during deployment, as it should do normally.
The job file below normally will trigger an error during deployment saying:

unable to get address for service "example-service": invalid port "8080": port label not found

However, the validation failed to detect the wrong check stanza if the job file is deployed first without check, then adding the check in a subsequent deployment.

Reproduction steps

  1. remove the check section from the job file below and deploy
  2. add the check section back and deploy
  3. deploy finishes "successfully" however no check is registered as the check is invalid.

Job file (if appropriate)

Click this to expand
job "example-job" {
  datacenters = ["dc1"]

  group "example-service-api-group" {
    service {
      name = "example-service"
      port = "8080"

      check {
        type     = "http"
        path     = "/"
        interval = "5s"
        timeout  = "1s"
      }
    }

    task "example-fake" {
      driver = "docker"

      config {
        image = "nicholasjackson/fake-service:v0.12.0"
      }

      env {
        LISTEN_ADDR = "0.0.0.0:8080"
      }
    }
  }
}
@tgross tgross changed the title invalid update to service definition does not fail during deployment invalid update to service definition does not fail during registration Dec 8, 2020
@tgross
Copy link
Member

tgross commented Dec 8, 2020

I tested this out on the Nomad 1.0-rc and I was not able to get the validation error whether I added the check in an update or in the initial registration.

@tgross tgross added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul type/bug labels Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/consul theme/service-discovery type/bug
Projects
None yet
Development

No branches or pull requests

3 participants