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
|
||||
}
|
||||
|
||||
conn := connConfig.ConnectionURL
|
||||
conn := connConfig.ConnectionString
|
||||
if len(conn) == 0 {
|
||||
conn = connConfig.ConnectionURL
|
||||
}
|
||||
|
|
|
@ -14,14 +14,20 @@ import (
|
|||
func TestBackend_basic(t *testing.T) {
|
||||
b, _ := Factory(logical.TestBackendConfig())
|
||||
|
||||
d := map[string]interface{}{
|
||||
d1 := map[string]interface{}{
|
||||
"connection_url": os.Getenv("MYSQL_DSN"),
|
||||
}
|
||||
d2 := map[string]interface{}{
|
||||
"value": os.Getenv("MYSQL_DSN"),
|
||||
}
|
||||
logicaltest.Test(t, logicaltest.TestCase{
|
||||
PreCheck: func() { testAccPreCheck(t) },
|
||||
Backend: b,
|
||||
Steps: []logicaltest.TestStep{
|
||||
testAccStepConfig(t, d, false),
|
||||
testAccStepConfig(t, d1, false),
|
||||
testAccStepRole(t),
|
||||
testAccStepReadCreds(t, "web"),
|
||||
testAccStepConfig(t, d2, false),
|
||||
testAccStepRole(t),
|
||||
testAccStepReadCreds(t, "web"),
|
||||
},
|
||||
|
|
|
@ -95,7 +95,9 @@ func (b *backend) pathConnectionWrite(
|
|||
}
|
||||
|
||||
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"`
|
||||
}
|
||||
|
||||
|
|
|
@ -138,7 +138,6 @@ allowed to read.
|
|||
<li>
|
||||
<span class="param">value</span>
|
||||
<span class="param-flags">optionsl</span>
|
||||
DEPRECATED; use "connection_url" instead
|
||||
</li>
|
||||
</ul>
|
||||
</dd>
|
||||
|
|
Loading…
Reference in New Issue