remotes/docker: allow 404 for POST /v2/token
Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
		| @@ -491,8 +491,9 @@ func (r *dockerBase) fetchTokenWithOAuth(ctx context.Context, to tokenOptions) ( | |||||||
| 	} | 	} | ||||||
| 	defer resp.Body.Close() | 	defer resp.Body.Close() | ||||||
|  |  | ||||||
| 	if resp.StatusCode == 405 && r.username != "" { | 	// Registries without support for POST may return 404 for POST /v2/token. | ||||||
| 		// It would be nice if registries would implement the specifications | 	// As of September 2017, GCR is known to return 404. | ||||||
|  | 	if (resp.StatusCode == 405 && r.username != "") || resp.StatusCode == 404 { | ||||||
| 		return r.getToken(ctx, to) | 		return r.getToken(ctx, to) | ||||||
| 	} else if resp.StatusCode < 200 || resp.StatusCode >= 400 { | 	} else if resp.StatusCode < 200 || resp.StatusCode >= 400 { | ||||||
| 		b, _ := ioutil.ReadAll(resp.Body) | 		b, _ := ioutil.ReadAll(resp.Body) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Akihiro Suda
					Akihiro Suda