mirror of https://github.com/kubernetes/kops.git
cloudmock - use ResourceType constants that are now in aws-sdk-go
This commit is contained in:
parent
58abaac891
commit
7e34e786ce
|
|
@ -128,7 +128,7 @@ func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*e
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
if strings.HasPrefix(*filter.Name, "tag:") {
|
if strings.HasPrefix(*filter.Name, "tag:") {
|
||||||
match = m.hasTag(ResourceTypeNatGateway, *ngw.NatGatewayId, filter)
|
match = m.hasTag(ec2.ResourceTypeNatgateway, *ngw.NatGatewayId, filter)
|
||||||
} else {
|
} else {
|
||||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||||
}
|
}
|
||||||
|
|
@ -145,7 +145,7 @@ func (m *MockEC2) DescribeNatGateways(request *ec2.DescribeNatGatewaysInput) (*e
|
||||||
}
|
}
|
||||||
|
|
||||||
copy := *ngw
|
copy := *ngw
|
||||||
copy.Tags = m.getTags(ResourceTypeNatGateway, id)
|
copy.Tags = m.getTags(ec2.ResourceTypeNatgateway, id)
|
||||||
ngws = append(ngws, ©)
|
ngws = append(ngws, ©)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -27,12 +27,6 @@ import (
|
||||||
"k8s.io/klog"
|
"k8s.io/klog"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
|
||||||
// Not (yet?) in aws-sdk-go
|
|
||||||
ResourceTypeNatGateway = "nat-gateway"
|
|
||||||
ResourceTypeAddress = "elastic-ip"
|
|
||||||
)
|
|
||||||
|
|
||||||
func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
|
func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
|
||||||
panic("Not implemented")
|
panic("Not implemented")
|
||||||
}
|
}
|
||||||
|
|
@ -70,13 +64,13 @@ func (m *MockEC2) addTag(resourceId string, tag *ec2.Tag) {
|
||||||
} else if strings.HasPrefix(resourceId, "igw-") {
|
} else if strings.HasPrefix(resourceId, "igw-") {
|
||||||
resourceType = ec2.ResourceTypeInternetGateway
|
resourceType = ec2.ResourceTypeInternetGateway
|
||||||
} else if strings.HasPrefix(resourceId, "nat-") {
|
} else if strings.HasPrefix(resourceId, "nat-") {
|
||||||
resourceType = ResourceTypeNatGateway
|
resourceType = ec2.ResourceTypeNatgateway
|
||||||
} else if strings.HasPrefix(resourceId, "dopt-") {
|
} else if strings.HasPrefix(resourceId, "dopt-") {
|
||||||
resourceType = ec2.ResourceTypeDhcpOptions
|
resourceType = ec2.ResourceTypeDhcpOptions
|
||||||
} else if strings.HasPrefix(resourceId, "rtb-") {
|
} else if strings.HasPrefix(resourceId, "rtb-") {
|
||||||
resourceType = ec2.ResourceTypeRouteTable
|
resourceType = ec2.ResourceTypeRouteTable
|
||||||
} else if strings.HasPrefix(resourceId, "eipalloc-") {
|
} else if strings.HasPrefix(resourceId, "eipalloc-") {
|
||||||
resourceType = ResourceTypeAddress
|
resourceType = ec2.ResourceTypeElasticIp
|
||||||
} else {
|
} else {
|
||||||
klog.Fatalf("Unknown resource-type in create tags: %v", resourceId)
|
klog.Fatalf("Unknown resource-type in create tags: %v", resourceId)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue