-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
Refactor resources "dockerimage" and "dockerdigest" into a new package "dockerimage" #418
Refactor resources "dockerimage" and "dockerdigest" into a new package "dockerimage" #418
Conversation
6a1bebc
to
d8fec75
Compare
While you are into this, you may have a look to #432 (comment) |
Yep, good thinking! Answered: #432 (comment) |
3bbd152
to
563f874
Compare
Ping @olblak this one is ready for review \o/ |
@olblak this PR does not have a specific issue, so I wasn't able to propose a milestone. WDYT about 0.18.0 ? |
…tests Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
…ir own packages to fully supports image architectures == Functional changes: - Use the Registry API v2 for all dockerdigest and dockerimage calls: * Deprecates the "Bearer Token" specification in favor of username + password (or anonymous), as it's generated automatically as part of the V2 API * Fully support Architecture for images (bugfix for DockerHub images, new feature for quay.io images) == Technical changes: - Introduces a utility `docker` package with sub-packages * Defines the default values for image naming * Introduces `docker/dockerimage` sub-package to manage Docker images parsing logic * Introduces `docker/dockerregistry` sub-package to manage registry API logic - Introduces packages to allow unit testing with mocks from HTTP clients and Docker utilities: * Introduces `docker/dockermocks` sub-package to provides mocks for DockerRegistry logic * Introduces `pkg/core/httpclient` package to define HTTP client interface (and allows mocking it on each package) - Refactor dockerdigest resource: * In its own package, using the docker/* utilities * Add a `New` constructor method * Add unit tests with >80% code coverage - Refactor dockerimage resource: * In its own package, using the docker/* utilities * Add a `New` constructor method * Add unit tests with >80% code coverage Signed-off-by: Damien Duportal <damien.duportal@gmail.com>
563f874
to
3bbb72e
Compare
Yep let exceptionally set the milestone on the pullrequest |
This pullrequest is a very nice refactoring especially considering the lack of documentation around docker library |
Co-authored-by: Olivier Vernin <me@olblak.com>
@olblak can you approve-it again? It's in "auto merge" but by adding your suggestion cancelled your previous approval |
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 PR comes from the work in #412 .
It introduces the following changes:
Functional changes:
Technical changes:
Add manifest examples to allow (manual) end to end testing for both providers
Introduce a method
New(Spec)
to allow initializing an object with a stateIntroduces a utility
docker
package with sub-packagesdocker/dockerimage
sub-package to manage Docker images parsing logicdocker/dockerregistry
sub-package to manage registry API logicIntroduces packages to allow unit testing with mocks from HTTP clients and Docker utilities:
docker/dockermocks
sub-package to provides mocks for DockerRegistry logicpkg/core/httpclient
package to define HTTP client interface (and allows mocking it on each package)Refactor dockerdigest resource:
New
constructor methodRefactor dockerimage resource:
New
constructor methodTest
To test this pull request, you can run the following commands:
Additional Information
Tradeoff
Potential improvement