terraform: state filter wasn't comparing resource names
This commit is contained in:
parent
0c56144d7f
commit
3480b7ebee
|
@ -99,6 +99,10 @@ func (f *StateFilter) filterSingle(a *ResourceAddress) []*StateFilterResult {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if a.Name != "" && a.Name != key.Name {
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
// Build the address for this resource
|
// Build the address for this resource
|
||||||
addr := &ResourceAddress{
|
addr := &ResourceAddress{
|
||||||
Path: m.Path[1:],
|
Path: m.Path[1:],
|
||||||
|
|
|
@ -69,6 +69,12 @@ func TestStateFilterFilter(t *testing.T) {
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
"resource in module 2": {
|
||||||
|
"resource-in-module-2.tfstate",
|
||||||
|
[]string{"module.foo.aws_instance.foo"},
|
||||||
|
[]string{},
|
||||||
|
},
|
||||||
|
|
||||||
"single count index": {
|
"single count index": {
|
||||||
"complete.tfstate",
|
"complete.tfstate",
|
||||||
[]string{"module.consul.aws_instance.consul-green[0]"},
|
[]string{"module.consul.aws_instance.consul-green[0]"},
|
||||||
|
|
Loading…
Reference in New Issue