Skip to content

Commit

Permalink
remove support for flatmap format
Browse files Browse the repository at this point in the history
  • Loading branch information
liamcervante committed Jan 9, 2024
1 parent 5ca56a9 commit 92de399
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 14 deletions.
4 changes: 3 additions & 1 deletion docs/plugin-protocol/tfplugin5.5.proto
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,9 @@ message MoveResourceState {
// moved from.
int64 source_schema_version = 3;

// The raw state of the resource being moved.
// The raw state of the resource being moved. Only the json field is
// populated, as there should be no legacy providers using the flatmap
// format that support newly introduced RPCs.
RawState source_state = 4;

// The resource type that the resource is being moved to.
Expand Down
4 changes: 3 additions & 1 deletion docs/plugin-protocol/tfplugin6.5.proto
Original file line number Diff line number Diff line change
Expand Up @@ -494,7 +494,9 @@ message MoveResourceState {
// moved from.
int64 source_schema_version = 3;

// The raw state of the resource being moved.
// The raw state of the resource being moved. Only the json field is
// populated, as there should be no legacy providers using the flatmap
// format that support newly introduced RPCs.
RawState source_state = 4;

// The resource type that the resource is being moved to.
Expand Down
3 changes: 1 addition & 2 deletions internal/plugin/grpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -640,8 +640,7 @@ func (p *GRPCProvider) MoveResourceState(r providers.MoveResourceStateRequest) (
SourceTypeName: r.SourceTypeName,
SourceSchemaVersion: r.SourceSchemaVersion,
SourceState: &proto.RawState{
Json: r.SourceStateJSON,
Flatmap: r.SourceStateFlatmap,
Json: r.SourceStateJSON,
},
TargetTypeName: r.TargetTypeName,
}
Expand Down
3 changes: 1 addition & 2 deletions internal/plugin6/grpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,7 @@ func (p *GRPCProvider) MoveResourceState(r providers.MoveResourceStateRequest) (
SourceTypeName: r.SourceTypeName,
SourceSchemaVersion: r.SourceSchemaVersion,
SourceState: &proto6.RawState{
Json: r.SourceStateJSON,
Flatmap: r.SourceStateFlatmap,
Json: r.SourceStateJSON,
},
TargetTypeName: r.TargetTypeName,
}
Expand Down
12 changes: 4 additions & 8 deletions internal/providers/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -406,14 +406,10 @@ type MoveResourceStateRequest struct {
// resource is being moved from.
SourceSchemaVersion int64

// SourceStateJSON and SourceStateFlatmap contain the state of the resource
// that is being moved. Because the schema is unknown, this contains only
// the raw data as stored in the state.
// SourceStateJSON is the current json state encoding.
// SourceStateFlatmap is the legacy flatmap encoding.
// Only one of these fields may be set for the move request.
SourceStateJSON []byte
SourceStateFlatmap map[string]string
// SourceStateJSON contains the state of the resource that is being moved.
// Because the schema is unknown, this contains only the raw data as stored
// in the state.
SourceStateJSON []byte

// TargetTypeName is the name of the resource type that the resource is
// being moved to.
Expand Down

0 comments on commit 92de399

Please sign in to comment.