clair/vulns: use basic auth whe token is empty (#64)

- solves issue with Clair/AWS ECR combo
This commit is contained in:
Paweł Prażak 2018-02-18 17:16:24 +01:00 committed by Jess Frazelle
parent 44f18c0104
commit 706e96ba44

View file

@ -109,7 +109,7 @@ func (c *Clair) NewClairLayer(r *registry.Registry, image string, fsLayers []sch
}
}
if useBasicAuth {
if token == "" || useBasicAuth {
h = map[string]string{
"Authorization": fmt.Sprintf("Basic %s", base64.StdEncoding.EncodeToString([]byte(r.Username+":"+r.Password))),
}