add versions to the provider schemas

We need to know the schema version for all resources. This is stored in
order to allow providers to upgrade the state from a known previous
version.
This commit is contained in:
James Bardin 2018-06-21 14:59:18 -04:00 committed by Martin Atkins
parent 1473d09c50
commit 91b5bbbde0
1 changed files with 10 additions and 3 deletions

View File

@ -66,18 +66,25 @@ type Interface interface {
type GetSchemaResponse struct {
// Provider is the schema for the provider itself.
Provider *configschema.Block
Provider Schema
// ResourceTypes map the resource type name to that type's schema.
ResourceTypes map[string]*configschema.Block
ResourceTypes map[string]Schema
// DataSources maps the data source name to that data source's schema.
DataSources map[string]*configschema.Block
DataSources map[string]Schema
// Diagnostics contains any warnings or errors from the method call.
Diagnostics tfdiags.Diagnostics
}
// Schema pairs a provider or resource schema with that schema's version.
// This is used to be able to upgrade the schema in
type Schema struct {
Version int
Block *configschema.Block
}
type ValidateProviderConfigRequest struct {
// Config is the complete configuration value for the provider.
Config cty.Value