Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove v2Resource and v2ResourceMap #2873

Draft
wants to merge 2 commits into
base: implement-shim-resource-for
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/tfbridge/schema_provider_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ func (f shimv2Factory) newResource(r shim.Resource) *schemav2.Resource {
}

func (f shimv2Factory) NewResource(r *schema.Resource) shim.Resource {
return shimv2.NewResource(f.newResource(r.Shim()))
return shimv2.NewTestOnlyResource(f.newResource(r.Shim()))
}

func (f shimv2Factory) NewInstanceState(id string) shim.InstanceState {
Expand Down
6 changes: 2 additions & 4 deletions pkg/tfbridge/schema_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3057,7 +3057,6 @@ func TestMakeTerraformInputsOnMapNestedObjects(t *testing.T) {
},
}

shimmedR := shimv2.NewResource(r)
type testCase struct {
name string
ps map[string]*SchemaInfo
Expand Down Expand Up @@ -3132,7 +3131,7 @@ func TestMakeTerraformInputsOnMapNestedObjects(t *testing.T) {
tc := tc

t.Run(tc.name, func(t *testing.T) {
i, _, err := makeTerraformInputsForConfig(tc.olds, tc.news, shimmedR.Schema(), tc.ps)
i, _, err := makeTerraformInputsForConfig(tc.olds, tc.news, shimv2.NewSchemaMap(r.Schema), tc.ps)
require.NoError(t, err)
require.Equal(t, tc.expect, i)
})
Expand Down Expand Up @@ -3161,7 +3160,6 @@ func TestRegress940(t *testing.T) {
},
},
}
shimmedR := shimv2.NewResource(r)

var olds, news resource.PropertyMap

Expand All @@ -3175,7 +3173,7 @@ func TestRegress940(t *testing.T) {
}),
}

result, _, err := makeTerraformInputsForConfig(olds, news, shimmedR.Schema(), map[string]*SchemaInfo{})
result, _, err := makeTerraformInputsForConfig(olds, news, shimv2.NewSchemaMap(r.Schema), map[string]*SchemaInfo{})

t.Run("no error with empty keys", func(t *testing.T) {
assert.NoError(t, err)
Expand Down
71 changes: 0 additions & 71 deletions pkg/tfshim/sdk-v2/flatten.go

This file was deleted.

Loading
Loading