mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
This commit is contained in:
parent
f15efbc207
commit
7a59971777
@ -24,6 +24,10 @@ func (c *Config) NewClient() (*dc.Client, error) {
|
|||||||
return nil, fmt.Errorf("ca_material, cert_material, and key_material must be specified")
|
return nil, fmt.Errorf("ca_material, cert_material, and key_material must be specified")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.CertPath != "" {
|
||||||
|
return nil, fmt.Errorf("cert_path must not be specified")
|
||||||
|
}
|
||||||
|
|
||||||
return dc.NewTLSClientFromBytes(c.Host, []byte(c.Cert), []byte(c.Key), []byte(c.Ca))
|
return dc.NewTLSClientFromBytes(c.Host, []byte(c.Cert), []byte(c.Key), []byte(c.Ca))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -18,25 +18,22 @@ func Provider() terraform.ResourceProvider {
|
|||||||
},
|
},
|
||||||
|
|
||||||
"ca_material": &schema.Schema{
|
"ca_material": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CA_MATERIAL", ""),
|
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CA_MATERIAL", ""),
|
||||||
ConflictsWith: []string{"cert_path"},
|
Description: "PEM-encoded content of Docker host CA certificate",
|
||||||
Description: "PEM-encoded content of Docker host CA certificate",
|
|
||||||
},
|
},
|
||||||
"cert_material": &schema.Schema{
|
"cert_material": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_MATERIAL", ""),
|
DefaultFunc: schema.EnvDefaultFunc("DOCKER_CERT_MATERIAL", ""),
|
||||||
ConflictsWith: []string{"cert_path"},
|
Description: "PEM-encoded content of Docker client certificate",
|
||||||
Description: "PEM-encoded content of Docker client certificate",
|
|
||||||
},
|
},
|
||||||
"key_material": &schema.Schema{
|
"key_material": &schema.Schema{
|
||||||
Type: schema.TypeString,
|
Type: schema.TypeString,
|
||||||
Optional: true,
|
Optional: true,
|
||||||
DefaultFunc: schema.EnvDefaultFunc("DOCKER_KEY_MATERIAL", ""),
|
DefaultFunc: schema.EnvDefaultFunc("DOCKER_KEY_MATERIAL", ""),
|
||||||
ConflictsWith: []string{"cert_path"},
|
Description: "PEM-encoded content of Docker client private key",
|
||||||
Description: "PEM-encoded content of Docker client private key",
|
|
||||||
},
|
},
|
||||||
|
|
||||||
"cert_path": &schema.Schema{
|
"cert_path": &schema.Schema{
|
||||||
|
Loading…
Reference in New Issue
Block a user