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

feat(app): add endpoint to verify docker image availability #990

Merged
merged 4 commits into from
Apr 4, 2022

Conversation

lorenzo-cavazzi
Copy link
Member

@lorenzo-cavazzi lorenzo-cavazzi commented Apr 1, 2022

/deploy #persist

This PR adds a new endpoint to verify the availability of any remote Docker image in a v2 registry GET /images?image_url=<registry-image_url>.

I believe importing the utils function directly in the route is not the best strategy, but I wasn't sure if it's worth it to make an Image Class just for that.
Feel free to adapt the PR in any way that makes sense 😁

Screenshot_20220401_163956

fix #989

@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner April 1, 2022 15:33
@lorenzo-cavazzi lorenzo-cavazzi temporarily deployed to renku-ci-nb-990 April 1, 2022 22:50 Inactive
@RenkuBot
Copy link
Contributor

RenkuBot commented Apr 1, 2022

You can access the deployment of this PR at https://renku-ci-nb-990.dev.renku.ch

@lorenzo-cavazzi lorenzo-cavazzi self-assigned this Apr 2, 2022
@olevski
Copy link
Member

olevski commented Apr 4, 2022

@lorenzo-cavazzi this is great. Thanks for doing this. I will just add a marshmallow schema for the request too. We use a plugin that allows us to do this. And with this you can get a 422 response when the request is not valid "for free". After that will approve and merge.

@olevski olevski deployed to renku-ci-nb-990 April 4, 2022 12:24 Active
@olevski
Copy link
Member

olevski commented Apr 4, 2022

A few additional changes here:

  • the response body is always blank because the status codes are enough to indicate if the image exists (200) or it does not (404)
  • relying on the status codes allows us to remove the schema definition
  • added a simple integration test for the endpoint

@olevski olevski merged commit e1a9f73 into master Apr 4, 2022
@olevski olevski deleted the 989-check-docker-image branch April 4, 2022 13:46
@olevski olevski restored the 989-check-docker-image branch November 30, 2022 21:43
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.

Add a GET check_docker_image endpoint
3 participants