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-" 
--------------------------------------------------------------------------
This commit is contained in:
ethan ho 2020-06-13 22:12:49 +08:00 committed by GitHub
parent e11e4bcbc7
commit 535efd34a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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