Don't deprecate value field yet
This commit is contained in:
parent
99f4969b20
commit
38b55bd8b1
|
@ -74,7 +74,7 @@ func (b *backend) DB(s logical.Storage) (*sql.DB, error) {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
conn := connConfig.ConnectionURL
|
conn := connConfig.ConnectionString
|
||||||
if len(conn) == 0 {
|
if len(conn) == 0 {
|
||||||
conn = connConfig.ConnectionURL
|
conn = connConfig.ConnectionURL
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,14 +14,20 @@ import (
|
||||||
func TestBackend_basic(t *testing.T) {
|
func TestBackend_basic(t *testing.T) {
|
||||||
b, _ := Factory(logical.TestBackendConfig())
|
b, _ := Factory(logical.TestBackendConfig())
|
||||||
|
|
||||||
d := map[string]interface{}{
|
d1 := map[string]interface{}{
|
||||||
"connection_url": os.Getenv("MYSQL_DSN"),
|
"connection_url": os.Getenv("MYSQL_DSN"),
|
||||||
}
|
}
|
||||||
|
d2 := map[string]interface{}{
|
||||||
|
"value": os.Getenv("MYSQL_DSN"),
|
||||||
|
}
|
||||||
logicaltest.Test(t, logicaltest.TestCase{
|
logicaltest.Test(t, logicaltest.TestCase{
|
||||||
PreCheck: func() { testAccPreCheck(t) },
|
PreCheck: func() { testAccPreCheck(t) },
|
||||||
Backend: b,
|
Backend: b,
|
||||||
Steps: []logicaltest.TestStep{
|
Steps: []logicaltest.TestStep{
|
||||||
testAccStepConfig(t, d, false),
|
testAccStepConfig(t, d1, false),
|
||||||
|
testAccStepRole(t),
|
||||||
|
testAccStepReadCreds(t, "web"),
|
||||||
|
testAccStepConfig(t, d2, false),
|
||||||
testAccStepRole(t),
|
testAccStepRole(t),
|
||||||
testAccStepReadCreds(t, "web"),
|
testAccStepReadCreds(t, "web"),
|
||||||
},
|
},
|
||||||
|
|
|
@ -95,7 +95,9 @@ func (b *backend) pathConnectionWrite(
|
||||||
}
|
}
|
||||||
|
|
||||||
type connectionConfig struct {
|
type connectionConfig struct {
|
||||||
ConnectionURL string `json:"connection_url"`
|
ConnectionURL string `json:"connection_url"`
|
||||||
|
// Deprecate "value" in coming releases
|
||||||
|
ConnectionString string `json:"value"`
|
||||||
MaxOpenConnections int `json:"max_open_connections"`
|
MaxOpenConnections int `json:"max_open_connections"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -138,7 +138,6 @@ allowed to read.
|
||||||
<li>
|
<li>
|
||||||
<span class="param">value</span>
|
<span class="param">value</span>
|
||||||
<span class="param-flags">optionsl</span>
|
<span class="param-flags">optionsl</span>
|
||||||
DEPRECATED; use "connection_url" instead
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</dd>
|
</dd>
|
||||||
|
|
Loading…
Reference in New Issue