Skip to content

Commit

Permalink
Merge pull request #48 from seh/correct-deregistration-status-code
Browse files Browse the repository at this point in the history
Correct expected status code for deregistration
  • Loading branch information
damtur authored Sep 27, 2016
2 parents 9e19e95 + 16c4de7 commit 1fc2cae
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net.go
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,9 @@ func (e *EurekaConnection) DeregisterInstance(ins *Instance) error {
log.Errorf("Could not complete deregistration, error: %s", err.Error())
return err
}
if rcode != 204 {
// Eureka promises to return HTTP status code upon deregistration success, but fargo used to accept status code 204
// here instead. Accommodate both for backward compatibility with any fake or proxy Eureka stand-ins.
if rcode != 200 && rcode != 204 {
log.Warningf("HTTP returned %d deregistering Instance=%s App=%s", rcode, ins.Id(), ins.App)
return fmt.Errorf("http returned %d possible failure deregistering instance\n", rcode)
}
Expand Down

0 comments on commit 1fc2cae

Please sign in to comment.