From b7d19e40f8444eb330f8aeb78ca42bdfcdf76d65 Mon Sep 17 00:00:00 2001 From: Paddy Carver Date: Wed, 20 Jun 2018 11:21:46 -0700 Subject: [PATCH] Deprecated -> DeprecationMessage. At the Enablement team's request, change from using `Deprecated` to `DeprecationMessage`, as it's a string value, not a boolean. --- helper/schema/data_source_resource_shim.go | 2 +- helper/schema/resource.go | 6 +++--- helper/schema/resource_test.go | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/helper/schema/data_source_resource_shim.go b/helper/schema/data_source_resource_shim.go index df9a3c034..8d93750ae 100644 --- a/helper/schema/data_source_resource_shim.go +++ b/helper/schema/data_source_resource_shim.go @@ -32,7 +32,7 @@ func DataSourceResourceShim(name string, dataSource *Resource) *Resource { // FIXME: Link to some further docs either on the website or in the // 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", name, ) diff --git a/helper/schema/resource.go b/helper/schema/resource.go index f96b2491d..d3be2d614 100644 --- a/helper/schema/resource.go +++ b/helper/schema/resource.go @@ -124,7 +124,7 @@ type Resource struct { Importer *ResourceImporter // 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 // 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) { warns, errs := schemaMap(r.Schema).Validate(c) - if r.Deprecated != "" { - warns = append(warns, r.Deprecated) + if r.DeprecationMessage != "" { + warns = append(warns, r.DeprecationMessage) } return warns, errs diff --git a/helper/schema/resource_test.go b/helper/schema/resource_test.go index 992c1aa04..ce631c2ac 100644 --- a/helper/schema/resource_test.go +++ b/helper/schema/resource_test.go @@ -859,7 +859,7 @@ func TestResourceInternalValidate(t *testing.T) { Optional: true, }, }, - Deprecated: "This resource has been deprecated.", + DeprecationMessage: "This resource has been deprecated.", }, true, true,