mirror of https://github.com/status-im/consul.git
Fix the TestAPI_CatalogRegistration test
This commit is contained in:
parent
9ff69194a2
commit
2343413bf0
|
@ -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.
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue