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
auth_config build function support #2647
base: main
Are you sure you want to change the base?
Conversation
On a side note, I ran autopep8 to deal with all the blank spaces but I wonder if this could be done automatically by the automation, it may help get PRs green faster. Attached the command: |
Signed-off-by: Yuval Goldberg <yuvigoldi@hotmail.com> Signed-off-by: jcardenes <jcardenes@viascience.com>
This is needed as otherwise any image relying on a private registry as in FROM private_image currently fails authentication Signed-off-by: jcardenes <jcardenes@viascience.com>
With this update build() should be able to also build images relying on private registries as in: FROM private_image Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Depending of feedback, I will refactor this unittest Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
Signed-off-by: jcardenes <jcardenes@viascience.com>
On my comment on automated styling there are some Github tools that may help |
# client = make_fake_client() | ||
# image = client.images.build(auth_config={"auth":1}) | ||
# client.api.build.assert_called_with() | ||
# client.api.inspect_image.assert_called_with( |
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.
Not sure why the call to inspect_image
here.
@utils.check_resource('image') | ||
def inspect_image(self, image): | ||
def inspect_image(self, image, auth_config=None): |
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.
Instead of passing auth_config
on all the client methods, you could just create a setter for it in the client.
That would also help you with the commented unit test when checking the inspect
.
Good point! Co-authored-by: Ulysses Souza <ulysses.souza@docker.com>
The goal of this PR is to allow the build function to support images relying on private registries as their base docker image layers, as in:
FROM private_image