diff --git a/agent/structs/structs.go b/agent/structs/structs.go index 9eb798bc3..14b50e5e6 100644 --- a/agent/structs/structs.go +++ b/agent/structs/structs.go @@ -322,6 +322,23 @@ func (r *DeregisterRequest) RequestDatacenter() string { return r.Datacenter } + +func (r *DeregisterRequest) UnmarshalJSON(data []byte) error { + type Alias DeregisterRequest + aux := &struct { + Address string // obsolete field - but we want to explicitly allow it + *Alias + }{ + Alias: (*Alias)(r), + } + + if err := lib.UnmarshalJSON(data, &aux); err != nil { + return err + } + return nil +} + + // QuerySource is used to pass along information about the source node // in queries so that we can adjust the response based on its network // coordinates. diff --git a/api/catalog.go b/api/catalog.go index 3fb055342..d10f21ef9 100644 --- a/api/catalog.go +++ b/api/catalog.go @@ -68,7 +68,7 @@ type CatalogRegistration struct { type CatalogDeregistration struct { Node string - Address string // Obsolete. + Address string `json:",omitempty"` // Obsolete. Datacenter string ServiceID string CheckID string