"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "internal/backend/remote-state/etcdv3/backend.go" between
terraform-1.0.2.tar.gz and terraform-1.0.3.tar.gz

About: Terraform is a tool for building, changing, and versioning a datacenter infrastructure (written in Go).

backend.go  (terraform-1.0.2):backend.go  (terraform-1.0.3)
package etcd package etcd
import ( import (
"context" "context"
etcdv3 "github.com/coreos/etcd/clientv3"
"github.com/coreos/etcd/pkg/transport"
"github.com/hashicorp/terraform/internal/backend" "github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/legacy/helper/schema" "github.com/hashicorp/terraform/internal/legacy/helper/schema"
etcdv3 "go.etcd.io/etcd/clientv3"
"go.etcd.io/etcd/pkg/transport"
) )
const ( const (
endpointsKey = "endpoints" endpointsKey = "endpoints"
usernameKey = "username" usernameKey = "username"
usernameEnvVarName = "ETCDV3_USERNAME" usernameEnvVarName = "ETCDV3_USERNAME"
passwordKey = "password" passwordKey = "password"
passwordEnvVarName = "ETCDV3_PASSWORD" passwordEnvVarName = "ETCDV3_PASSWORD"
maxRequestBytesKey = "max_request_bytes"
prefixKey = "prefix" prefixKey = "prefix"
lockKey = "lock" lockKey = "lock"
cacertPathKey = "cacert_path" cacertPathKey = "cacert_path"
certPathKey = "cert_path" certPathKey = "cert_path"
keyPathKey = "key_path" keyPathKey = "key_path"
) )
func New() backend.Backend { func New() backend.Backend {
s := &schema.Backend{ s := &schema.Backend{
Schema: map[string]*schema.Schema{ Schema: map[string]*schema.Schema{
skipping to change at line 52 skipping to change at line 53
DefaultFunc: schema.EnvDefaultFunc(usernameEnvVar Name, ""), DefaultFunc: schema.EnvDefaultFunc(usernameEnvVar Name, ""),
}, },
passwordKey: &schema.Schema{ passwordKey: &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Description: "Password used to connect to the etc d cluster.", Description: "Password used to connect to the etc d cluster.",
DefaultFunc: schema.EnvDefaultFunc(passwordEnvVar Name, ""), DefaultFunc: schema.EnvDefaultFunc(passwordEnvVar Name, ""),
}, },
maxRequestBytesKey: &schema.Schema{
Type: schema.TypeInt,
Optional: true,
Description: "The max request size to send to etc
d.",
Default: 0,
},
prefixKey: &schema.Schema{ prefixKey: &schema.Schema{
Type: schema.TypeString, Type: schema.TypeString,
Optional: true, Optional: true,
Description: "An optional prefix to be added to k eys when to storing state in etcd.", Description: "An optional prefix to be added to k eys when to storing state in etcd.",
Default: "", Default: "",
}, },
lockKey: &schema.Schema{ lockKey: &schema.Schema{
Type: schema.TypeBool, Type: schema.TypeBool,
Optional: true, Optional: true,
skipping to change at line 131 skipping to change at line 139
if v, ok := b.data.GetOk(endpointsKey); ok { if v, ok := b.data.GetOk(endpointsKey); ok {
config.Endpoints = retrieveEndpoints(v) config.Endpoints = retrieveEndpoints(v)
} }
if v, ok := b.data.GetOk(usernameKey); ok && v.(string) != "" { if v, ok := b.data.GetOk(usernameKey); ok && v.(string) != "" {
config.Username = v.(string) config.Username = v.(string)
} }
if v, ok := b.data.GetOk(passwordKey); ok && v.(string) != "" { if v, ok := b.data.GetOk(passwordKey); ok && v.(string) != "" {
config.Password = v.(string) config.Password = v.(string)
} }
if v, ok := b.data.GetOk(maxRequestBytesKey); ok && v.(int) != 0 {
config.MaxCallSendMsgSize = v.(int)
}
if v, ok := b.data.GetOk(cacertPathKey); ok && v.(string) != "" { if v, ok := b.data.GetOk(cacertPathKey); ok && v.(string) != "" {
tlsInfo.TrustedCAFile = v.(string) tlsInfo.TrustedCAFile = v.(string)
} }
if v, ok := b.data.GetOk(certPathKey); ok && v.(string) != "" { if v, ok := b.data.GetOk(certPathKey); ok && v.(string) != "" {
tlsInfo.CertFile = v.(string) tlsInfo.CertFile = v.(string)
} }
if v, ok := b.data.GetOk(keyPathKey); ok && v.(string) != "" { if v, ok := b.data.GetOk(keyPathKey); ok && v.(string) != "" {
tlsInfo.KeyFile = v.(string) tlsInfo.KeyFile = v.(string)
} }
 End of changes. 5 change blocks. 
2 lines changed or deleted 14 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)