Deprecated -> DeprecationMessage.

At the Enablement team's request, change from using `Deprecated` to
`DeprecationMessage`, as it's a string value, not a boolean.
This commit is contained in:
Paddy Carver 2018-06-20 11:21:46 -07:00
parent 0dd2408d65
commit b7d19e40f8
3 changed files with 5 additions and 5 deletions

View File

@ -32,7 +32,7 @@ func DataSourceResourceShim(name string, dataSource *Resource) *Resource {
// FIXME: Link to some further docs either on the website or in the // FIXME: Link to some further docs either on the website or in the
// changelog, once such a thing exists. // changelog, once such a thing exists.
dataSource.Deprecated = fmt.Sprintf( dataSource.DeprecationMessage = fmt.Sprintf(
"using %s as a resource is deprecated; consider using the data source instead", "using %s as a resource is deprecated; consider using the data source instead",
name, name,
) )

View File

@ -124,7 +124,7 @@ type Resource struct {
Importer *ResourceImporter Importer *ResourceImporter
// If non-empty, this string is emitted as a warning during Validate. // If non-empty, this string is emitted as a warning during Validate.
Deprecated string DeprecationMessage string
// Timeouts allow users to specify specific time durations in which an // Timeouts allow users to specify specific time durations in which an
// operation should time out, to allow them to extend an action to suit their // operation should time out, to allow them to extend an action to suit their
@ -267,8 +267,8 @@ func (r *Resource) Diff(
func (r *Resource) Validate(c *terraform.ResourceConfig) ([]string, []error) { func (r *Resource) Validate(c *terraform.ResourceConfig) ([]string, []error) {
warns, errs := schemaMap(r.Schema).Validate(c) warns, errs := schemaMap(r.Schema).Validate(c)
if r.Deprecated != "" { if r.DeprecationMessage != "" {
warns = append(warns, r.Deprecated) warns = append(warns, r.DeprecationMessage)
} }
return warns, errs return warns, errs

View File

@ -859,7 +859,7 @@ func TestResourceInternalValidate(t *testing.T) {
Optional: true, Optional: true,
}, },
}, },
Deprecated: "This resource has been deprecated.", DeprecationMessage: "This resource has been deprecated.",
}, },
true, true,
true, true,