add prefix 'library' only to official images in the path (#27)

This commit is contained in:
Peter Nyilas 2018-01-02 09:31:06 +00:00 committed by Manuel Vogel
parent b06fa7e2ba
commit 98bede4dbe

View file

@ -41,9 +41,11 @@ func dataSourceDockerRegistryImageRead(d *schema.ResourceData, meta interface{})
pullOpts.Repository = strings.Replace(pullOpts.Repository, pullOpts.Registry+"/", "", 1)
}
// Docker prefixes 'library' to official images in the path; 'consul' becomes 'library/consul'
if !strings.Contains(pullOpts.Repository, "/") {
pullOpts.Repository = "library/" + pullOpts.Repository
if pullOpts.Registry == "registry.hub.docker.com" {
// Docker prefixes 'library' to official images in the path; 'consul' becomes 'library/consul'
if !strings.Contains(pullOpts.Repository, "/") {
pullOpts.Repository = "library/" + pullOpts.Repository
}
}
if pullOpts.Tag == "" {