mirror of https://github.com/kubernetes/kops.git
cloudmock: update to support tag-key query on securitygroup
This commit is contained in:
parent
32ec8d8253
commit
8250cf0571
|
@ -18,7 +18,6 @@ package mockec2
|
|||
|
||||
import (
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
|
@ -146,11 +145,7 @@ func (m *MockEC2) DescribeSecurityGroups(request *ec2.DescribeSecurityGroupsInpu
|
|||
}
|
||||
|
||||
default:
|
||||
if strings.HasPrefix(*filter.Name, "tag:") {
|
||||
match = m.hasTag(ec2.ResourceTypeSecurityGroup, *sg.GroupId, filter)
|
||||
} else {
|
||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||
}
|
||||
match = m.hasTag(ec2.ResourceTypeSecurityGroup, *sg.GroupId, filter)
|
||||
}
|
||||
|
||||
if !match {
|
||||
|
|
|
@ -133,7 +133,7 @@ func DescribeSecurityGroups(cloud fi.Cloud, clusterName string) (map[string]*ec2
|
|||
}
|
||||
response, err := c.EC2().DescribeSecurityGroups(request)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("error listing VPCs: %v", err)
|
||||
return nil, fmt.Errorf("error listing SecurityGroups: %v", err)
|
||||
}
|
||||
|
||||
for _, group := range response.SecurityGroups {
|
||||
|
|
Loading…
Reference in New Issue