Skip to content
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

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open

Conversation

Chuseuiti
Copy link

@Chuseuiti Chuseuiti commented Aug 19, 2020

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

@Chuseuiti
Copy link
Author

Chuseuiti commented Aug 20, 2020

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:
autopep8 --select=W293 --in-place your_file.py

YuviGold and others added 18 commits August 20, 2020 15:57
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>
Signed-off-by: jcardenes <jcardenes@viascience.com>
@Chuseuiti
Copy link
Author

On my comment on automated styling there are some Github tools that may help
https://github.com/marketplace/restyled-io

# 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(
Copy link
Collaborator

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):
Copy link
Collaborator

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.

Chuseuiti and others added 3 commits September 16, 2020 00:15
Good point!

Co-authored-by: Ulysses Souza <ulysses.souza@docker.com>
@milas milas requested a review from aiordache as a code owner August 15, 2023 13:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants