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:
parent
0dd2408d65
commit
b7d19e40f8
|
@ -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,
|
||||||
)
|
)
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in New Issue