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
|
||||
}
|
||||
|
||||
// Fix the type to be the type we have
|
||||
rs.Type = r.State.Type
|
||||
|
||||
l.Lock()
|
||||
result.Resources[r.Id] = rs
|
||||
l.Unlock()
|
||||
|
|
|
@ -219,6 +219,12 @@ func TestTerraformRefresh(t *testing.T) {
|
|||
if !reflect.DeepEqual(s.Resources["aws_instance.web"], rpAWS.RefreshReturn) {
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue