Remove unneeded validation logic
Our checkpoint file is now in a shape such that go's built in
marshalling and unmarshalling is sufficent, so we can remove the code
we had on our decode path to do extra validation
@@ -13,7 +13,6 @@ import (
"github.com/pulumi/pulumi/pkg/resource/environment"
"github.com/pulumi/pulumi/pkg/tokens"
"github.com/pulumi/pulumi/pkg/util/contract"
- "github.com/pulumi/pulumi/pkg/util/mapper"
"github.com/pulumi/pulumi/pkg/workspace"
)
@@ -73,24 +72,6 @@ func getEnvironment(name tokens.QName) (*deploy.Target, *deploy.Snapshot, error)
return nil, nil, err
}
- // Next, use the mapping infrastructure to validate the contents.
- // IDEA: we can eliminate this redundant unmarshaling once Go supports strict unmarshaling.
- var obj map[string]interface{}
- if err = m.Unmarshal(b, &obj); err != nil {
- return nil, nil, err
- }
-
- if obj["latest"] != nil {
- if latest, islatest := obj["latest"].(map[string]interface{}); islatest {
- delete(latest, "resources") // remove the resources, since they require custom marshaling.
- }
- }
- md := mapper.New(nil)
- var ignore environment.Checkpoint // just for errors.
- if err = md.Decode(obj, &ignore); err != nil {
- return nil, nil, err
- }
-
target, snapshot := environment.DeserializeCheckpoint(&checkpoint)
contract.Assert(target != nil)
return target, snapshot, nil
