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

Failed Clair V2 scanning #167

Open
KeyboardNerd opened this issue Dec 14, 2018 · 0 comments
Open

Failed Clair V2 scanning #167

KeyboardNerd opened this issue Dec 14, 2018 · 0 comments

Comments

@KeyboardNerd
Copy link

Repro steps:
reg vulns --clair ubuntu:latest

Actual Result:
2018/12/14 14:17:10 clair.layers.post url=http://127.0.0.1:6050/v1/layers name=
2018/12/14 14:17:10 clair.layers.post req.Body={"Layer":{"Path":"https://quay.io/v2/chris_ricci/wordpress-nginx-php5/blobs/","Format":"Docker"}}
2018/12/14 14:17:10 clair.layers.post resp.Status=400 Bad Request
clair error: could not process a layer which does not have a name

Root cause:
Given that ubuntu:latest has empty layers,
https://github.com/genuinetools/reg/blob/master/clair/vulns.go#L34
filteredLayers is a dictionary map[int]distribution.Descriptor, but here, it's being used as a list.
When calling NewClairLayer, some indexes are missing because we skipped the empty layers, but since go map defaults to construct the default distribution.Descriptor, the name is empty.

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

No branches or pull requests

2 participants