mirror of
https://github.com/kreuzwerker/terraform-provider-docker.git
synced 2026-01-10 08:42:55 -05:00
Merge branch 'master' of github.com:terraform-providers/terraform-provider-docker
This commit is contained in:
commit
7c01a67dc6
3 changed files with 13 additions and 4 deletions
|
|
@ -104,8 +104,12 @@ func getImageDigest(registry, image, tag, username, password string, fallback bo
|
|||
req.SetBasicAuth(username, password)
|
||||
}
|
||||
|
||||
// Set this header so that we get the v2 manifest back from the registry.
|
||||
req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v2+json")
|
||||
// We accept schema v2 manifests and manifest lists, and also OCI types
|
||||
req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.v2+json")
|
||||
req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.list.v2+json")
|
||||
req.Header.Add("Accept", "application/vnd.oci.image.manifest.v1+json")
|
||||
req.Header.Add("Accept", "application/vnd.oci.image.index.v1+json")
|
||||
|
||||
if fallback {
|
||||
// Fallback to this header if the registry does not support the v2 manifest like gcr.io
|
||||
req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v1+prettyjws")
|
||||
|
|
|
|||
|
|
@ -250,6 +250,7 @@ func resourceDockerContainer() *schema.Resource {
|
|||
Type: schema.TypeSet,
|
||||
Description: "Specification for mounts to be added to containers created as part of the service",
|
||||
Optional: true,
|
||||
ForceNew: true,
|
||||
Elem: &schema.Resource{
|
||||
Schema: map[string]*schema.Schema{
|
||||
"target": {
|
||||
|
|
|
|||
|
|
@ -346,8 +346,12 @@ func deleteDockerRegistryImage(pushOpts internalPushImageOptions, sha256Digest,
|
|||
req.SetBasicAuth(username, password)
|
||||
}
|
||||
|
||||
// Set this header so that we get the v2 manifest back from the registry.
|
||||
req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v2+json")
|
||||
// We accept schema v2 manifests and manifest lists, and also OCI types
|
||||
req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.v2+json")
|
||||
req.Header.Add("Accept", "application/vnd.docker.distribution.manifest.list.v2+json")
|
||||
req.Header.Add("Accept", "application/vnd.oci.image.manifest.v1+json")
|
||||
req.Header.Add("Accept", "application/vnd.oci.image.index.v1+json")
|
||||
|
||||
if fallback {
|
||||
// Fallback to this header if the registry does not support the v2 manifest like gcr.io
|
||||
req.Header.Set("Accept", "application/vnd.docker.distribution.manifest.v1+prettyjws")
|
||||
|
|
|
|||
Loading…
Reference in a new issue