helper/diff: InstanceState conversion

This commit is contained in:
Mitchell Hashimoto 2014-09-16 16:56:14 -07:00
parent 81abdcafdc
commit 90dd00ee3c
2 changed files with 14 additions and 14 deletions

View File

@ -61,7 +61,7 @@ type PreProcessFunc func(string) string
// Diff returns the ResourceDiff for a resource given its state and // Diff returns the ResourceDiff for a resource given its state and
// configuration. // configuration.
func (b *ResourceBuilder) Diff( func (b *ResourceBuilder) Diff(
s *terraform.ResourceState, s *terraform.InstanceState,
c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) { c *terraform.ResourceConfig) (*terraform.ResourceDiff, error) {
attrs := make(map[string]*terraform.ResourceAttrDiff) attrs := make(map[string]*terraform.ResourceAttrDiff)

View File

@ -17,7 +17,7 @@ func TestResourceBuilder_attrSetComputed(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "bar", "foo": "bar",
}, nil) }, nil)
@ -47,7 +47,7 @@ func TestResourceBuilder_attrSetComputedComplex(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "foo", ID: "foo",
Attributes: map[string]string{ Attributes: map[string]string{
"foo.#": "0", "foo.#": "0",
@ -75,7 +75,7 @@ func TestResourceBuilder_replaceComputed(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "foo", ID: "foo",
Attributes: map[string]string{ Attributes: map[string]string{
"foo": "bar", "foo": "bar",
@ -99,7 +99,7 @@ func TestResourceBuilder_complex(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "foo", ID: "foo",
Attributes: map[string]string{ Attributes: map[string]string{
"ignore": "1", "ignore": "1",
@ -138,7 +138,7 @@ func TestResourceBuilder_complexReplace(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "foo", ID: "foo",
Attributes: map[string]string{ Attributes: map[string]string{
"ignore": "1", "ignore": "1",
@ -180,7 +180,7 @@ func TestResourceBuilder_computedAttrsUpdate(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
Attributes: map[string]string{"foo": "foo"}, Attributes: map[string]string{"foo": "foo"},
} }
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
@ -210,7 +210,7 @@ func TestResourceBuilder_new(t *testing.T) {
ComputedAttrs: []string{"private_ip"}, ComputedAttrs: []string{"private_ip"},
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "bar", "foo": "bar",
@ -244,7 +244,7 @@ func TestResourceBuilder_preProcess(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "foo", "foo": "foo",
}, nil) }, nil)
@ -283,7 +283,7 @@ func TestResourceBuilder_preProcessUnknown(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "${var.unknown}", "foo": "${var.unknown}",
}, map[string]string{ }, map[string]string{
@ -313,7 +313,7 @@ func TestResourceBuilder_requiresNew(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "1", ID: "1",
Attributes: map[string]string{ Attributes: map[string]string{
"ami": "foo", "ami": "foo",
@ -345,7 +345,7 @@ func TestResourceBuilder_same(t *testing.T) {
ComputedAttrs: []string{"private_ip"}, ComputedAttrs: []string{"private_ip"},
} }
state := &terraform.ResourceState{ state := &terraform.InstanceState{
ID: "1", ID: "1",
Attributes: map[string]string{ Attributes: map[string]string{
"foo": "bar", "foo": "bar",
@ -372,7 +372,7 @@ func TestResourceBuilder_unknown(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "${var.unknown}", "foo": "${var.unknown}",
@ -403,7 +403,7 @@ func TestResourceBuilder_vars(t *testing.T) {
}, },
} }
state := &terraform.ResourceState{} state := &terraform.InstanceState{}
c := testConfig(t, map[string]interface{}{ c := testConfig(t, map[string]interface{}{
"foo": "${var.foo}", "foo": "${var.foo}",