optiopay / klar

Integration of Clair and Docker Registry
MIT License
506 stars 138 forks source link

Add support for Docker Image Manifest V 2, Schema 2 #37

Closed furuholm closed 7 years ago

furuholm commented 7 years ago

Solves #27

hashmap commented 7 years ago

can we add a unit test?

furuholm commented 7 years ago

Sure. I would say that the manifest decoding parts makes the most sense to test. Extracting these to separate functions would make testing quite simple. Sounds good?

hashmap commented 7 years ago

totally, thanks!

furuholm commented 7 years ago

I have added a unit test for pulling manifest v2 images. I'm not sure why the unit test pulls docker-registry.domain.com/nginx:1b29e1531c whereas the injected response is for logstash. I did the same for the new unit test to make it consistent. I can change it to match the response if you'd like...

I also did a refactoring of the digest/blobsum refactoring, but while the code is more clear it introduces an extra copy of each digest/blobsum which makes it less efficient. I put that commit on top to make it easy to remove if you prefer to drop it. Whichever is fine for me.

hashmap commented 7 years ago

@furuholm excellent work, thanks!