terraform: Type should always be set on ResourceState
This commit is contained in:
parent
d64ba66edb
commit
84a645712b
|
@ -133,6 +133,9 @@ func (t *Terraform) refreshWalkFn(result *State) depgraph.WalkFunc {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fix the type to be the type we have
|
||||||
|
rs.Type = r.State.Type
|
||||||
|
|
||||||
l.Lock()
|
l.Lock()
|
||||||
result.Resources[r.Id] = rs
|
result.Resources[r.Id] = rs
|
||||||
l.Unlock()
|
l.Unlock()
|
||||||
|
|
|
@ -219,6 +219,12 @@ func TestTerraformRefresh(t *testing.T) {
|
||||||
if !reflect.DeepEqual(s.Resources["aws_instance.web"], rpAWS.RefreshReturn) {
|
if !reflect.DeepEqual(s.Resources["aws_instance.web"], rpAWS.RefreshReturn) {
|
||||||
t.Fatalf("bad: %#v", s.Resources)
|
t.Fatalf("bad: %#v", s.Resources)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
for _, r := range s.Resources {
|
||||||
|
if r.Type == "" {
|
||||||
|
t.Fatalf("no type: %#v", r)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func TestTerraformRefresh_state(t *testing.T) {
|
func TestTerraformRefresh_state(t *testing.T) {
|
||||||
|
|
Loading…
Reference in New Issue