daemon/router/image: initialize default authConfig#50730
daemon/router/image: initialize default authConfig#50730thaJeztah merged 1 commit intomoby:masterfrom
Conversation
|
Thanks! And thanks for the stack-trace in the ticket; as a follow-up, I want to look at some of the uses of these so that they gracefully handle "no auth config" ( FWIW; I had a quick check on moby/daemon/server/router/image/image_routes.go Lines 100 to 105 in f74e5d4 |
thaJeztah
left a comment
There was a problem hiding this comment.
LGTM if CI is happy (perhaps linters want authConfig := ®istry.AuthConfig{})
4570ab9 to
44599fe
Compare
Indeed, thanks. Looking at how other functions handle the header, perhaps we can do the I would believe that the Looking at the source code, it seems that a missing header would result in an empty Thoughts? |
|
Yes, I'd be fine with changing it to try unconditionally for now. My ultimate goal is to be more specific about whether auth is passed or not, so that code-paths further down the line can also make decisions whether they're dealing with an unauthenticated request (and skip some handling, or use alternatives), or authentication is present. That's not present yet, so I think it's good to just change it to "unconditionally try to unmarshal" (as |
Signed-off-by: Tiago Teixeira <[email protected]>
44599fe to
033ec8b
Compare
|
I did a force push to avoid multiple commits, however, I don't think the CI is picking that ... Any idea how to force the CI to run? Make "Draft" and "Ready" again? |
|
I gave it a kick; it requires approval for first-time contributors; should be running now 👍 |
|
All green! Thanks! |
- What I did
Initialize
authConfigto an empty value. This should avoid nil pointer dereferences.- How I did it
Initialize with an empty value.
- How to verify it
Invoking an image push without authentication headers (no
X-Registry-Auth) should not cause a nil pointer dereference panic.