Closed eplightning closed 4 months ago
Hmm any idea why Windows tests try to push the image without any credentials?
I'm not sure if that makes sense but I have absolutely no experience with Windows.
I suppose we could do what Java does and explictly mark push call as requiring authentication and send empty object in that case: https://github.com/docker-java/docker-java/blob/a1393bf2e1265ba1e6eca4240af55396852f8a7c/docker-java-core/src/main/java/com/github/dockerjava/core/exec/AbstrDockerCmdExec.java#L75
Great! Thank you..
Currently
bollard
unconditionally sends credentials (X-Registry-*) headers to Docker API, even when credentials are not specified (None
is passed). For example request for image pull will look like this, despite having no specified credentials:(the base64 decoded auth is
{"username":null,"password":null,"auth":null,"email":null,"serveraddress":null,"identitytoken":null,"registrytoken":null}
)For Podman doing so causes it use those "empty" credentials instead of the default system ones, breaking functionality like registry mirrors and so on.
This PR does a small refactoring and sets this header to be empty when they are not specified, bringing it closer to behavior of other Docker libraries (empty or not set).