You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Build cross-tests for checking that Pulumi and TF handle state upgrades identically.
TF implements state upgraders feature in the SDKv2 that amounts to having providers specify code that modifies state written by previous versions of the provider.
// Implementation of a single schema version state upgrade.typeStateUpgraderstruct {
// Version is the version schema that this Upgrader will handle, converting// it to Version+1.Versionint// Type describes the schema that this function can upgrade. Type is// required to decode the schema if the state was stored in a legacy// flatmap format.Type cty.Type// Upgrade takes the JSON encoded state and the provider meta value, and// upgrades the state one single schema version. The provided state is// deocded into the default json types using a map[string]interface{}. It// is up to the StateUpgradeFunc to ensure that the returned value can be// encoded using the new schema.UpgradeStateUpgradeFunc
}
typeStateUpgradeFuncfunc(ctx context.Context, rawStatemap[string]interface{}, metainterface{}) (map[string]interface{}, error)
Build cross-tests for checking that Pulumi and TF handle state upgrades identically.
TF implements state upgraders feature in the SDKv2 that amounts to having providers specify code that modifies state written by previous versions of the provider.
In Go pseudo-code this could look like this:
Having significant coverage against a range of schemas would help refactor the code with confidence.
The text was updated successfully, but these errors were encountered: