Skip to content

Commit 7a59971

Browse files
mkuzminstack72
authored andcommitted
provider/docker: fix regression, cert_path stop working (hashicorp#10754) (hashicorp#10801)
1 parent f15efbc commit 7a59971

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎builtin/providers/docker/config.go‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ func (c *Config) NewClient() (*dc.Client, error) {
2424
return nil, fmt.Errorf("ca_material, cert_material, and key_material must be specified")
2525
}
2626

27+
if c.CertPath != "" {
28+
return nil, fmt.Errorf("cert_path must not be specified")
29+
}
30+
2731
return dc.NewTLSClientFromBytes(c.Host, []byte(c.Cert), []byte(c.Key), []byte(c.Ca))
2832
}
2933

‎builtin/providers/docker/provider.go‎

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,25 +18,22 @@ func Provider() terraform.ResourceProvider {
1818
},
1919

2020
"ca_material": &schema.Schema{
21-
Type: schema.TypeString,
22-
Optional: true,
23-
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CA_MATERIAL", ""),
24-
ConflictsWith: []string{"cert_path"},
25-
Description: "PEM-encoded content of Docker host CA certificate",
21+
Type: schema.TypeString,
22+
Optional: true,
23+
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CA_MATERIAL", ""),
24+
Description: "PEM-encoded content of Docker host CA certificate",
2625
},
2726
"cert_material": &schema.Schema{
28-
Type: schema.TypeString,
29-
Optional: true,
30-
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_MATERIAL", ""),
31-
ConflictsWith: []string{"cert_path"},
32-
Description: "PEM-encoded content of Docker client certificate",
27+
Type: schema.TypeString,
28+
Optional: true,
29+
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_MATERIAL", ""),
30+
Description: "PEM-encoded content of Docker client certificate",
3331
},
3432
"key_material": &schema.Schema{
35-
Type: schema.TypeString,
36-
Optional: true,
37-
DefaultFunc: schema.EnvDefaultFunc("DOCKER_KEY_MATERIAL", ""),
38-
ConflictsWith: []string{"cert_path"},
39-
Description: "PEM-encoded content of Docker client private key",
33+
Type: schema.TypeString,
34+
Optional: true,
35+
DefaultFunc: schema.EnvDefaultFunc("DOCKER_KEY_MATERIAL", ""),
36+
Description: "PEM-encoded content of Docker client private key",
4037
},
4138

4239
"cert_path": &schema.Schema{

0 commit comments

Comments
 (0)