internal/provider: include image name in error message (#223)

Without this, if the Docker image is not found, it's difficult to know
which image exactly is 404'ing - you get a very generic error message,
which can make it difficult to spot typos or other problems with the
image name.

Co-authored-by: Manuel Vogel <mavogel@posteo.de>
This commit is contained in:
Kevin Burke 2021-06-21 00:52:34 -07:00 committed by GitHub
parent eaee1edf91
commit c888f812a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -80,7 +80,7 @@ func dataSourceDockerRegistryImageRead(ctx context.Context, d *schema.ResourceDa
if err != nil {
digest, err = getImageDigest(pullOpts.Registry, pullOpts.Repository, pullOpts.Tag, username, password, insecureSkipVerify, true)
if err != nil {
return diag.Errorf("Got error when attempting to fetch image version from registry: %s", err)
return diag.Errorf("Got error when attempting to fetch image version %s:%s from registry: %s", pullOpts.Repository, pullOpts.Tag, err)
}
}