From 2a1c9ec96a95b224bdf28fc3221739f7db5cdc0d Mon Sep 17 00:00:00 2001 From: Wang Yan Date: Tue, 1 Jun 2021 18:30:40 +0800 Subject: [PATCH] update the log level of robot v1 context (#15037) The robotv1 context uses the robot$ as a hardcoded prefix to identify robot account, it will raise error for a valid robotv2 account with this prefix. Update the log level to avoid the redundant logs for the default installation. Signed-off-by: Wang Yan --- src/server/middleware/security/robot.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server/middleware/security/robot.go b/src/server/middleware/security/robot.go index 81a977569..c965e2db4 100644 --- a/src/server/middleware/security/robot.go +++ b/src/server/middleware/security/robot.go @@ -46,7 +46,7 @@ func (r *robot) Generate(req *http.Request) security.Context { } rtk, err := pkg_token.Parse(defaultOpt, robotTk, rClaims) if err != nil { - log.Errorf("failed to decrypt robot token: %v", err) + log.Debugf("failed to decrypt robot token of v1 robot: %s, as: %v", robotName, err) return nil } // Do authn for robot account, as Harbor only stores the token ID, just validate the ID and disable.