-
Notifications
You must be signed in to change notification settings - Fork 362
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
ISSUE-887: Fix error logging on docker push task when auth config fil… #894
Conversation
I have noticed that you have changed the |
04f9d8a
to
9d94d4e
Compare
okay, I don't know why the functional tests have failed. I have not yet found anything but will look into it later in a few hours' time. |
Okay, I cannot reproduce the same error in the functional tests that was shown in this build:
My tests run properly, but only when I start with a clean docker slate and with max-workers=1
Docker version 19.03.1 If you need any other information, please let me know. |
The failing functional tests is probably a flaky test case. You can ignore that for now. I will look into the root cause and fix for it soon. Moreover, I will review your code over the weekend. |
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.
We should start by adding test cases for the reported issues from users. Only then we should get started and jump to conclusions/change the code. Switching the log level from error to warn will only mask real issues by basically ignoring them.
@@ -127,7 +130,8 @@ class RegistryAuthLocator { | |||
} | |||
|
|||
} catch(Exception ex) { | |||
logger.error('Failure when attempting to lookup auth config ' + | |||
logger.warn('Failure when attempting to lookup auth config ' + |
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.
For now, I'd not want to change the log level for anything that might go wrong. It probably indicates a real issue. If the parsing of the JSON file doesn't work properly then that's a bug.
So I'd still want to see an error for the following cases:
- The JSON cannot be parsed.
- The auth config cannot be determined.
- The credentials cannot be resolved.
IMHO those are all valid use cases. So if you have a config file then I'd expect it to work.
@@ -106,6 +106,9 @@ class RegistryAuthLocator { | |||
configFile.exists() ? 'exists' : 'does not exist', | |||
commandPathPrefix) | |||
|
|||
if (!(configFile.exists())) { |
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.
I am OK with adding this in, however, it will only cover some of the issues users reported.
@@ -106,6 +106,9 @@ class RegistryAuthLocator { | |||
configFile.exists() ? 'exists' : 'does not exist', | |||
commandPathPrefix) | |||
|
|||
if (!(configFile.exists())) { |
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.
This should use isFile()
instead.
Thanks for the pull request. I just committed the change separately: fe2c7bc |
…e is not present
This fixes some of the problems mentioned in ISSUE-887, that logging