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

connect sidecar_task name is not configurable #7680

Closed
shoenig opened this issue Apr 9, 2020 · 1 comment · Fixed by #7684
Closed

connect sidecar_task name is not configurable #7680

shoenig opened this issue Apr 9, 2020 · 1 comment · Fixed by #7684
Assignees
Labels
theme/consul/connect Consul Connect integration type/bug

Comments

@shoenig
Copy link
Member

shoenig commented Apr 9, 2020

The documentation for sidecar_task stanza indicates the name should be configurable, however trying to do so results in an error.

https://nomadproject.io/docs/job-specification/sidecar_task/#name

Job file

$ cat example.nomad 
job "countdash" {
  datacenters = ["dc1"]

  group "api" {
    network {
      mode = "bridge"
    }

    service {
      name = "count-api"
      port = "9001"

      connect {
	sidecar_service {}
	sidecar_task {
	  name = "my-sidecar"
	}
      }
    }

    task "web" {
      driver = "docker"

      config {
        image = "hashicorpnomad/counter-api:v1"
      }
    }
  }
}

Output

 $ nomad job run example.nomad
Error getting job struct: Error parsing job file from example.nomad: error parsing 'job': group: 'api', service (0): 'count-api', sidecar_task, 1 error occurred:
	* invalid key: name
@shoenig shoenig added theme/consul/connect Consul Connect integration type/bug labels Apr 9, 2020
@shoenig shoenig self-assigned this Apr 10, 2020
shoenig added a commit that referenced this issue Apr 10, 2020
Before, the submitted jobspec for sidecar_task would pass
through 2 key validation steps - once for the subset specific
to connect sidecar task definitions, and once again for the set
of normal task definition where the task would actually get
unmarshalled.

The valid keys for the normal task definition did not include
"name", which is supposed to be configurable for the sidecar
task. To fix this, just eliminate the double validation step,
and instead pass-in the correct set of keys to validate against
to the one generic task parser.

Fixes #7680
@github-actions
Copy link

github-actions bot commented Nov 9, 2022

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 Nov 9, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
theme/consul/connect Consul Connect integration type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant