-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[DO NOT MERGE] registry: Suppress unnecessary unauthorized errors #10715
[DO NOT MERGE] registry: Suppress unnecessary unauthorized errors #10715
Conversation
[test] @liggitt PTAL |
|
||
logger.Debugf("Origin auth: found deferred error for %s/%s: %v", namespace, name, repoErr) | ||
return repoErr | ||
return checkPendingErrors(ctx, r.namespace, r.name) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between the ctx passed in here and the ctx held by the repo. it was being done this way to preserve the original logging, but I don't know what additional info is logged by the ctx held by the repo
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between the ctx passed in here and the ctx held by the repo. it was being done this way to preserve the original logging, but I don't know what additional info is logged by the ctx held by the repo
In general, the most up to date context should be used for logging. Theoretically, context held by the repo may be stale, which would result in incorrect logging statements. But most probably, the two context objects will be the same.
Using r.ctx
is mostly a hold-over from times when middleware methods used to lack the context argument.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why you need the (repository).checkPendingErrors
after this change?
Just a wrapper which adds two arguments ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@miminar still there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a wrapper which adds two arguments ?
@legionus exactly. I've removed the wrapper.
220a2ae
to
45a2b28
Compare
Thanks! Items hopefully addressed. |
45a2b28
to
5ce125c
Compare
Flakes #10738 and #8427 in job https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/8574/ re-[test] |
@liggitt May I ask for one more pass? |
Is this still for 1.4? |
Probably not. It's a low risk though. @legionus would you please take a look? |
pkg/dockerregistry/server/auth.go
Outdated
// Default to openshift if not present | ||
realm = "origin" | ||
// Default to origin if not present | ||
realm = defaultRealm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use getStringOption
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's there now.
5ce125c
to
4d42379
Compare
@legionus PTAL one more time. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
4d42379
to
dce3327
Compare
During a cross-repo mount request, it's quite common to forbid access to a source repository picked by Docker daemon regardless of user having access there. This produces error messages that appear severe but they're not. This patch delays their logging until the very last repository access check and lowers their severity. Signed-off-by: Michal Minář <[email protected]>
dce3327
to
18c554e
Compare
Strange, I don't see an error in https://ci.openshift.redhat.com/jenkins/job/test_pull_requests_origin_conformance/11139/console. Just:
Re-starting. |
Evaluated for origin test up to 18c554e |
continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pr_origin/13710/) (Base Commit: 76141a4) |
@mfojtik this seem to be good for merge. |
@miminar this seems big, I would prefer fork_ami and QE sign off before merging. WDYT? |
@mfojtik I don't find it necessary. But for your deep calm and sound sleep, I'll do it 😉. |
Started fork_ami at https://ci.openshift.redhat.com/jenkins/job/fork_ami/329/ |
QE found out some unexpected entries in logs. It looks like this needs some more work. |
Origin Action Required: Pull request cannot be automatically merged, please rebase your branch from latest HEAD and push again |
During a cross-repo mount request, it's quite common to forbid access to a source repository picked by Docker daemon regardless of user having access there. This produces error messages that appear severe but in fact they're not. This patch delays their logging until the very last repository access check and lowers their severity.
Closes #9649