optiopay / klar

Integration of Clair and Docker Registry
MIT License
507 stars 140 forks source link

Speed up image name parsing #45

Closed hashmap closed 7 years ago

hashmap commented 7 years ago

This fix removes hostname resolution from image name parsing function. It decreases time of tests execution from 15 secs to 0.02 on my machine. The drawback is that we can't use short hostname (except localhost) as a registry hostname. However docker client itself doesn't support such hostnames, so it's a safe assumption for Klar. https://github.com/moby/moby/blob/master/vendor/github.com/docker/distribution/reference/normalize.go#L64