Skip to content
This repository was archived by the owner on Oct 3, 2019. It is now read-only.

Handle non-existent docker image #2

Open
groovytron opened this issue Jun 6, 2017 · 3 comments
Open

Handle non-existent docker image #2

groovytron opened this issue Jun 6, 2017 · 3 comments

Comments

@groovytron
Copy link
Owner

MipApplication's model is populated using Microbadger's API using the pre_save method. How is it possible to handle a non-existent image and trigger an error?

This part of the logic might have to be moved into the serializer. It's a good idea if the API is called only when the instance needs to be updated or created. Otherwise performances will be affected. It looks like it's only called on creation and update: http://www.django-rest-framework.org/api-guide/serializers/#validation

@groovytron
Copy link
Owner Author

Another case could be that either the namespace or the image is empty (or None). Adding a unit test for this case might be needed.

@groovytron
Copy link
Owner Author

Also think about making tests at the API level to ensure that the API always answer with a valid HTTP status and the MicrobadgerService does not slows it down too much (thinking about trying to push a non-existent docker image or an image that has been indexed in MicroBadger yet).

How to handle the cases where the image has not been indexed by MicroBadger?

@greut
Copy link

greut commented Jun 15, 2017

Mock! mock! and mock!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants