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
|
||||
}
|
||||
|
||||
if a.Name != "" && a.Name != key.Name {
|
||||
continue
|
||||
}
|
||||
|
||||
// Build the address for this resource
|
||||
addr := &ResourceAddress{
|
||||
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": {
|
||||
"complete.tfstate",
|
||||
[]string{"module.consul.aws_instance.consul-green[0]"},
|
||||
|
|
Loading…
Reference in New Issue