diff --git a/contributing/checklist-jobspec.md b/contributing/checklist-jobspec.md index 83db385f8..5d6215124 100644 --- a/contributing/checklist-jobspec.md +++ b/contributing/checklist-jobspec.md @@ -15,6 +15,7 @@ * [ ] Add structs/fields to `nomad/structs` package * Validation happens in this package and must be implemented * Implement other methods and tests from `api/` package + * Note that analogous struct field names should match with `api/` package * [ ] Add conversion between `api/` and `nomad/structs` in `command/agent/job_endpoint.go` * [ ] Add check for job diff in `nomad/structs/diff.go` * Note that fields must be listed in alphabetical order in `FieldDiff` slices in `nomad/structs/diff_test.go` diff --git a/nomad/structs/services.go b/nomad/structs/services.go index d12bb697f..578b1dd22 100644 --- a/nomad/structs/services.go +++ b/nomad/structs/services.go @@ -889,7 +889,9 @@ type ConsulProxy struct { // Expose configures the consul proxy.expose stanza to "open up" endpoints // used by task-group level service checks using HTTP or gRPC protocols. - Expose *ConsulExposeConfig + // + // Use json tag to match with field name in api/ + Expose *ConsulExposeConfig `json:"ExposeConfig"` // Config is a proxy configuration. It is opaque to Nomad and passed // directly to Consul. @@ -905,7 +907,7 @@ func (p *ConsulProxy) Copy() *ConsulProxy { newP := &ConsulProxy{ LocalServiceAddress: p.LocalServiceAddress, LocalServicePort: p.LocalServicePort, - Expose: p.Expose, + Expose: p.Expose.Copy(), } if n := len(p.Upstreams); n > 0 { @@ -1009,7 +1011,8 @@ func (u *ConsulUpstream) Equals(o *ConsulUpstream) bool { // ExposeConfig represents a Consul Connect expose jobspec stanza. type ConsulExposeConfig struct { - Paths []ConsulExposePath + // Use json tag to match with field name in api/ + Paths []ConsulExposePath `json:"Path"` } type ConsulExposePath struct {