From 535efd34a0e528f0a4f0b2ae1b7b5ff8887ee967 Mon Sep 17 00:00:00 2001 From: ethan ho <66869006+goodluckethan@users.noreply.github.com> Date: Sat, 13 Jun 2020 22:12:49 +0800 Subject: [PATCH] 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 "": cannot parse "-01-02T15:04:05Z07:00" as "0-" -------------------------------------------------------------------------- --- cmd/peer-rest-server.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/peer-rest-server.go b/cmd/peer-rest-server.go index 8bd1807fc..1b8e00b1c 100644 --- a/cmd/peer-rest-server.go +++ b/cmd/peer-rest-server.go @@ -770,7 +770,7 @@ func (s *peerRESTServer) ServerUpdateHandler(w http.ResponseWriter, r *http.Requ var latestReleaseTime time.Time var err error if latestRelease := vars[peerRESTLatestRelease]; latestRelease != "" { - latestReleaseTime, err = time.Parse(latestRelease, time.RFC3339) + latestReleaseTime, err = time.Parse(time.RFC3339, latestRelease) if err != nil { s.writeErrorResponse(w, err) return