Fix peer server update failure (#9824)

When updating all servers following the constructions of mc update,
only the endpoint server will be updated successfully.
All the other peer servers' updating failed due to the error below:
--------------------------------------------------------------------------
parsing time "2006-01-02T15:04:05Z07:00" as "<release version>": cannot parse "-01-02T15:04:05Z07:00" as "0-" 
--------------------------------------------------------------------------
master
ethan ho 5 years ago committed by GitHub
parent e11e4bcbc7
commit 535efd34a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      cmd/peer-rest-server.go

@ -770,7 +770,7 @@ func (s *peerRESTServer) ServerUpdateHandler(w http.ResponseWriter, r *http.Requ
var latestReleaseTime time.Time var latestReleaseTime time.Time
var err error var err error
if latestRelease := vars[peerRESTLatestRelease]; latestRelease != "" { if latestRelease := vars[peerRESTLatestRelease]; latestRelease != "" {
latestReleaseTime, err = time.Parse(latestRelease, time.RFC3339) latestReleaseTime, err = time.Parse(time.RFC3339, latestRelease)
if err != nil { if err != nil {
s.writeErrorResponse(w, err) s.writeErrorResponse(w, err)
return return

Loading…
Cancel
Save