providers: Consistently use int64 for schema versions
The rest of Terraform is still using uint64 for this in various spots, but we'll update that gradually later. We use int64 here because that matches what's used in our protobuf definition, and unsigned integers are not portable across all of the protobuf target languages anyway.
This commit is contained in:
parent
2fd016738a
commit
72e279e6b2
|
@ -34,7 +34,7 @@ func testApplyDiff(t *testing.T,
|
|||
diff *terraform.InstanceDiff) {
|
||||
|
||||
testSchema := providers.Schema{
|
||||
Version: uint64(resource.SchemaVersion),
|
||||
Version: int64(resource.SchemaVersion),
|
||||
Block: resourceSchemaToBlock(resource.Schema),
|
||||
}
|
||||
|
||||
|
@ -338,7 +338,7 @@ func TestShimResourceDiff_Timeout_diff(t *testing.T) {
|
|||
}
|
||||
|
||||
testSchema := providers.Schema{
|
||||
Version: uint64(r.SchemaVersion),
|
||||
Version: int64(r.SchemaVersion),
|
||||
Block: resourceSchemaToBlock(r.Schema),
|
||||
}
|
||||
|
||||
|
|
|
@ -57,7 +57,7 @@ func protoSchemaNestedBlock(name string, b *configschema.NestedBlock) *proto.Sch
|
|||
// ProtoToProviderSchema takes a proto.Schema and converts it to a providers.Schema.
|
||||
func ProtoToProviderSchema(s *proto.Schema) providers.Schema {
|
||||
return providers.Schema{
|
||||
Version: uint64(s.Version),
|
||||
Version: s.Version,
|
||||
Block: ProtoToConfigSchema(s.Block),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ type GetSchemaResponse struct {
|
|||
// Schema pairs a provider or resource schema with that schema's version.
|
||||
// This is used to be able to upgrade the schema in UpgradeResourceState.
|
||||
type Schema struct {
|
||||
Version uint64
|
||||
Version int64
|
||||
Block *configschema.Block
|
||||
}
|
||||
|
||||
|
@ -135,7 +135,7 @@ type UpgradeResourceStateRequest struct {
|
|||
TypeName string
|
||||
|
||||
// Version is version of the schema that created the current state.
|
||||
Version int
|
||||
Version int64
|
||||
|
||||
// RawStateJSON and RawStateFlatmap contiain the state that needs to be
|
||||
// upgraded to match the current schema version. Because the schema is
|
||||
|
|
Loading…
Reference in New Issue