split PriorStateRaw into JSON and Flatmap
This way the provider doesn't need to be concerned with determining the state encoding.
This commit is contained in:
parent
91b5bbbde0
commit
6a1b57a1e4
|
@ -130,11 +130,14 @@ type UpgradeResourceStateRequest struct {
|
||||||
// Version is version of the schema that created the current state.
|
// Version is version of the schema that created the current state.
|
||||||
Version int
|
Version int
|
||||||
|
|
||||||
// PriorStateRaw is the state that needs to be upgraded to match the current
|
// RawStateJSON and RawStateFlatmap contiain the state that needs to be
|
||||||
// schema version. Because the schema is unknown, this contains only the
|
// upgraded to match the current schema version. Because the schema is
|
||||||
// raw bytes as stored in the state. It is up to the provider to interpret
|
// unknown, this contains only the raw data as stored in the state.
|
||||||
// the payload and return a state encoded with the current schema.
|
// RawStateJSON is the current json state encoding.
|
||||||
PriorStateRaw []byte
|
// RawStateFlatmap is the legacy flatmap encoding.
|
||||||
|
// Only on of these fields may be set for the upgrade request.
|
||||||
|
RawStateJSON []byte
|
||||||
|
RawStateFlatmap map[string]string
|
||||||
}
|
}
|
||||||
|
|
||||||
type UpgradeResourceStateResponse struct {
|
type UpgradeResourceStateResponse struct {
|
||||||
|
|
Loading…
Reference in New Issue