integ/kubernetes/containerd/debian/patches/0002-fix_errorcode.patch
Daniel Safta 5993c6715c Add debian package for containerd
- created required debian structured
- succesfully built the package
- applied stx changes
- unit tests run successfully

NOTE: patches/0003, patches/0004, patches/0005
provide the upstream changes between v1.4.5
and v1.4.6, such that we provide a 1.4.6 containerd.
We want 1.4.6 to align with CentOS.

Story: 2009221
Task: 43585
Signed-off-by: Daniel Safta <daniel.safta@windriver.com>
Change-Id: I5af677c90342bae7c10101bf465e1db79c716671
2021-10-27 12:02:46 +03:00

29 lines
1.3 KiB
Diff

From 7bdbc31f47a801dc9215163ae5cd84581f1d83e2 Mon Sep 17 00:00:00 2001
From: Daniel Safta <daniel.safta@windriver.com>
Date: Mon, 11 Oct 2021 12:13:15 +0300
Subject: [PATCH] fix errorcode
docker registry in StarlingX 3.0 branch doesn't support POST method
for token and will return 400. Switch to GET method to get token if
StatusCode is 400.
---
remotes/docker/authorizer.go | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/remotes/docker/authorizer.go b/remotes/docker/authorizer.go
index 67e4aea..c06b222 100644
--- a/remotes/docker/authorizer.go
+++ b/remotes/docker/authorizer.go
@@ -284,7 +284,7 @@ func (ah *authHandler) doBearerAuth(ctx context.Context) (token string, err erro
// Registries without support for POST may return 404 for POST /v2/token.
// As of September 2017, GCR is known to return 404.
// As of February 2018, JFrog Artifactory is known to return 401.
- if (errStatus.StatusCode == 405 && to.Username != "") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 {
+ if (errStatus.StatusCode == 405 && to.Username != "") || errStatus.StatusCode == 404 || errStatus.StatusCode == 401 || errStatus.StatusCode == 400 {
resp, err := auth.FetchToken(ctx, ah.client, ah.header, to)
if err != nil {
return "", err
--
2.17.1