mirror of https://github.com/kubernetes/kops.git
First test of a fi.Task
This commit is contained in:
parent
23947ed44d
commit
f4092d0113
|
@ -0,0 +1,144 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockec2
|
||||
|
||||
import (
|
||||
"encoding/binary"
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
"net"
|
||||
)
|
||||
|
||||
func (m *MockEC2) AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AllocateAddress(request *ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error) {
|
||||
glog.Infof("AllocateAddress: %v", request)
|
||||
|
||||
m.addressNumber++
|
||||
n := m.addressNumber
|
||||
|
||||
publicIP := net.ParseIP("192.0.2.0").To4()
|
||||
{
|
||||
v := binary.BigEndian.Uint32(publicIP)
|
||||
v += uint32(n)
|
||||
publicIP = make(net.IP, len(publicIP))
|
||||
binary.BigEndian.PutUint32(publicIP, v)
|
||||
}
|
||||
|
||||
address := &ec2.Address{
|
||||
AllocationId: s(fmt.Sprintf("eip-%d", n)),
|
||||
Domain: s("vpc"),
|
||||
PublicIp: s(publicIP.String()),
|
||||
}
|
||||
m.Addresses = append(m.Addresses, address)
|
||||
response := &ec2.AllocateAddressOutput{
|
||||
AllocationId: address.AllocationId,
|
||||
Domain: address.Domain,
|
||||
PublicIp: address.PublicIp,
|
||||
}
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeAddresses(request *ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error) {
|
||||
glog.Infof("DescribeAddresses: %v", request)
|
||||
|
||||
var addresses []*ec2.Address
|
||||
|
||||
if len(request.AllocationIds) != 0 {
|
||||
request.Filters = append(request.Filters, &ec2.Filter{Name: s("allocation-id"), Values: request.AllocationIds})
|
||||
}
|
||||
for _, address := range m.Addresses {
|
||||
allFiltersMatch := true
|
||||
for _, filter := range request.Filters {
|
||||
match := false
|
||||
switch *filter.Name {
|
||||
|
||||
case "allocation-id":
|
||||
for _, v := range filter.Values {
|
||||
if *address.AllocationId == *v {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
|
||||
case "public-ip":
|
||||
for _, v := range filter.Values {
|
||||
if *address.PublicIp == *v {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||
}
|
||||
|
||||
if !match {
|
||||
allFiltersMatch = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !allFiltersMatch {
|
||||
continue
|
||||
}
|
||||
|
||||
copy := *address
|
||||
addresses = append(addresses, ©)
|
||||
}
|
||||
|
||||
response := &ec2.DescribeAddressesOutput{
|
||||
Addresses: addresses,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
func (m *MockEC2) ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
|
@ -22,7 +22,18 @@ import (
|
|||
)
|
||||
|
||||
type MockEC2 struct {
|
||||
addressNumber int
|
||||
Addresses []*ec2.Address
|
||||
|
||||
RouteTables []*ec2.RouteTable
|
||||
|
||||
subnetNumber int
|
||||
Subnets []*ec2.Subnet
|
||||
|
||||
Tags []*ec2.TagDescription
|
||||
|
||||
vpcNumber int
|
||||
Vpcs map[string]*vpcInfo
|
||||
}
|
||||
|
||||
var _ ec2iface.EC2API = &MockEC2{}
|
||||
|
|
|
@ -0,0 +1,21 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockec2
|
||||
|
||||
func s(v string) *string {
|
||||
return &v
|
||||
}
|
|
@ -0,0 +1,94 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockec2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (m *MockEC2) CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) CreateSubnet(request *ec2.CreateSubnetInput) (*ec2.CreateSubnetOutput, error) {
|
||||
glog.Infof("CreateSubnet: %v", request)
|
||||
|
||||
m.subnetNumber++
|
||||
n := m.subnetNumber
|
||||
|
||||
subnet := &ec2.Subnet{
|
||||
SubnetId: s(fmt.Sprintf("subnet-%d", n)),
|
||||
VpcId: request.VpcId,
|
||||
CidrBlock: request.CidrBlock,
|
||||
}
|
||||
m.Subnets = append(m.Subnets, subnet)
|
||||
response := &ec2.CreateSubnetOutput{
|
||||
Subnet: subnet,
|
||||
}
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeSubnets(request *ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) {
|
||||
glog.Infof("DescribeSubnets: %v", request)
|
||||
|
||||
var subnets []*ec2.Subnet
|
||||
|
||||
for _, subnet := range m.Subnets {
|
||||
allFiltersMatch := true
|
||||
for _, filter := range request.Filters {
|
||||
match := false
|
||||
switch *filter.Name {
|
||||
|
||||
default:
|
||||
if strings.HasPrefix(*filter.Name, "tag:") {
|
||||
match = m.hasTag(ec2.ResourceTypeSubnet, *subnet.SubnetId, filter)
|
||||
} else {
|
||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if !match {
|
||||
allFiltersMatch = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !allFiltersMatch {
|
||||
continue
|
||||
}
|
||||
|
||||
copy := *subnet
|
||||
copy.Tags = m.getTags(ec2.ResourceTypeSubnet, *subnet.SubnetId)
|
||||
subnets = append(subnets, ©)
|
||||
}
|
||||
|
||||
response := &ec2.DescribeSubnetsOutput{
|
||||
Subnets: subnets,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
|
@ -0,0 +1,163 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockec2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
"strings"
|
||||
)
|
||||
|
||||
func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) CreateTags(request *ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) {
|
||||
glog.Infof("CreateTags %v", request)
|
||||
|
||||
for _, v := range request.Resources {
|
||||
resourceId := *v
|
||||
resourceType := ""
|
||||
if strings.HasPrefix(resourceId, "subnet-") {
|
||||
resourceType = ec2.ResourceTypeSubnet
|
||||
} else if strings.HasPrefix(resourceId, "vpc-") {
|
||||
resourceType = ec2.ResourceTypeVpc
|
||||
} else {
|
||||
glog.Fatalf("Unknown resource-type in create tags: %v", resourceId)
|
||||
}
|
||||
|
||||
for _, tag := range request.Tags {
|
||||
t := &ec2.TagDescription{
|
||||
Key: tag.Key,
|
||||
Value: tag.Value,
|
||||
ResourceId: s(resourceId),
|
||||
ResourceType: s(resourceType),
|
||||
}
|
||||
m.Tags = append(m.Tags, t)
|
||||
}
|
||||
}
|
||||
response := &ec2.CreateTagsOutput{}
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) hasTag(resourceType string, resourceId string, filter *ec2.Filter) bool {
|
||||
name := *filter.Name
|
||||
if strings.HasPrefix(name, "tag:") {
|
||||
tagKey := name[4:]
|
||||
|
||||
for _, tag := range m.Tags {
|
||||
if *tag.ResourceId != resourceId {
|
||||
continue
|
||||
}
|
||||
if *tag.ResourceType != resourceType {
|
||||
continue
|
||||
}
|
||||
if *tag.Key != tagKey {
|
||||
continue
|
||||
}
|
||||
|
||||
for _, v := range filter.Values {
|
||||
if *tag.Value == *v {
|
||||
return true
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
glog.Fatalf("Unsupported filter: %v", filter)
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (m *MockEC2) getTags(resourceType string, resourceId string) []*ec2.Tag {
|
||||
var tags []*ec2.Tag
|
||||
for _, tag := range m.Tags {
|
||||
if *tag.ResourceId != resourceId {
|
||||
continue
|
||||
}
|
||||
if *tag.ResourceType != resourceType {
|
||||
continue
|
||||
}
|
||||
|
||||
t := &ec2.Tag{
|
||||
Key: tag.Key,
|
||||
Value: tag.Value,
|
||||
}
|
||||
tags = append(tags, t)
|
||||
}
|
||||
return tags
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeTags(request *ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) {
|
||||
glog.Infof("DescribeTags %v", request)
|
||||
|
||||
var tags []*ec2.TagDescription
|
||||
|
||||
for _, tag := range m.Tags {
|
||||
allFiltersMatch := true
|
||||
for _, filter := range request.Filters {
|
||||
match := false
|
||||
switch *filter.Name {
|
||||
case "key":
|
||||
for _, v := range filter.Values {
|
||||
if *v == *tag.Key {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
|
||||
case "resource-id":
|
||||
for _, v := range filter.Values {
|
||||
if *v == *tag.ResourceId {
|
||||
match = true
|
||||
}
|
||||
}
|
||||
|
||||
default:
|
||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||
}
|
||||
|
||||
if !match {
|
||||
allFiltersMatch = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !allFiltersMatch {
|
||||
continue
|
||||
}
|
||||
|
||||
copy := *tag
|
||||
tags = append(tags, ©)
|
||||
}
|
||||
|
||||
response := &ec2.DescribeTagsOutput{
|
||||
Tags: tags,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error {
|
||||
panic("Not implemented")
|
||||
return nil
|
||||
}
|
|
@ -31,16 +31,6 @@ func (m *MockEC2) AcceptVpcPeeringConnection(*ec2.AcceptVpcPeeringConnectionInpu
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AllocateAddressRequest(*ec2.AllocateAddressInput) (*request.Request, *ec2.AllocateAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AllocateAddress(*ec2.AllocateAddressInput) (*ec2.AllocateAddressOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AllocateHostsRequest(*ec2.AllocateHostsInput) (*request.Request, *ec2.AllocateHostsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -51,26 +41,6 @@ func (m *MockEC2) AllocateHosts(*ec2.AllocateHostsInput) (*ec2.AllocateHostsOutp
|
|||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssignPrivateIpAddressesRequest(*ec2.AssignPrivateIpAddressesInput) (*request.Request, *ec2.AssignPrivateIpAddressesOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssignPrivateIpAddresses(*ec2.AssignPrivateIpAddressesInput) (*ec2.AssignPrivateIpAddressesOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssociateAddressRequest(*ec2.AssociateAddressInput) (*request.Request, *ec2.AssociateAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssociateAddress(*ec2.AssociateAddressInput) (*ec2.AssociateAddressOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) AssociateDhcpOptionsRequest(*ec2.AssociateDhcpOptionsInput) (*request.Request, *ec2.AssociateDhcpOptionsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -376,22 +346,6 @@ func (m *MockEC2) CreateSpotDatafeedSubscription(*ec2.CreateSpotDatafeedSubscrip
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateSubnetRequest(*ec2.CreateSubnetInput) (*request.Request, *ec2.CreateSubnetOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateSubnet(*ec2.CreateSubnetInput) (*ec2.CreateSubnetOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateTagsRequest(*ec2.CreateTagsInput) (*request.Request, *ec2.CreateTagsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateTags(*ec2.CreateTagsInput) (*ec2.CreateTagsOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateVolumeRequest(*ec2.CreateVolumeInput) (*request.Request, *ec2.Volume) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -400,14 +354,6 @@ func (m *MockEC2) CreateVolume(*ec2.CreateVolumeInput) (*ec2.Volume, error) {
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateVpc(*ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateVpcEndpointRequest(*ec2.CreateVpcEndpointInput) (*request.Request, *ec2.CreateVpcEndpointOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -656,14 +602,6 @@ func (m *MockEC2) DescribeAccountAttributes(*ec2.DescribeAccountAttributesInput)
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeAddressesRequest(*ec2.DescribeAddressesInput) (*request.Request, *ec2.DescribeAddressesOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeAddresses(*ec2.DescribeAddressesInput) (*ec2.DescribeAddressesOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeAvailabilityZonesRequest(*ec2.DescribeAvailabilityZonesInput) (*request.Request, *ec2.DescribeAvailabilityZonesOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -1052,26 +990,6 @@ func (m *MockEC2) DescribeStaleSecurityGroups(*ec2.DescribeStaleSecurityGroupsIn
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeSubnetsRequest(*ec2.DescribeSubnetsInput) (*request.Request, *ec2.DescribeSubnetsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeSubnets(*ec2.DescribeSubnetsInput) (*ec2.DescribeSubnetsOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeTagsRequest(*ec2.DescribeTagsInput) (*request.Request, *ec2.DescribeTagsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeTags(*ec2.DescribeTagsInput) (*ec2.DescribeTagsOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeTagsPages(*ec2.DescribeTagsInput, func(*ec2.DescribeTagsOutput, bool) bool) error {
|
||||
panic("Not implemented")
|
||||
return nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVolumeAttributeRequest(*ec2.DescribeVolumeAttributeInput) (*request.Request, *ec2.DescribeVolumeAttributeOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -1104,14 +1022,6 @@ func (m *MockEC2) DescribeVolumesPages(*ec2.DescribeVolumesInput, func(*ec2.Desc
|
|||
panic("Not implemented")
|
||||
return nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcAttribute(*ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcClassicLinkRequest(*ec2.DescribeVpcClassicLinkInput) (*request.Request, *ec2.DescribeVpcClassicLinkOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -1152,14 +1062,6 @@ func (m *MockEC2) DescribeVpcPeeringConnections(*ec2.DescribeVpcPeeringConnectio
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcs(*ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpnConnectionsRequest(*ec2.DescribeVpnConnectionsInput) (*request.Request, *ec2.DescribeVpnConnectionsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
@ -1528,14 +1430,6 @@ func (m *MockEC2) RejectVpcPeeringConnection(*ec2.RejectVpcPeeringConnectionInpu
|
|||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) ReleaseAddressRequest(*ec2.ReleaseAddressInput) (*request.Request, *ec2.ReleaseAddressOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) ReleaseAddress(*ec2.ReleaseAddressInput) (*ec2.ReleaseAddressOutput, error) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) ReleaseHostsRequest(*ec2.ReleaseHostsInput) (*request.Request, *ec2.ReleaseHostsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
|
|
|
@ -0,0 +1,133 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockec2
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/aws/aws-sdk-go/aws"
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"github.com/golang/glog"
|
||||
"strings"
|
||||
)
|
||||
|
||||
type vpcInfo struct {
|
||||
main ec2.Vpc
|
||||
attributes ec2.DescribeVpcAttributeOutput
|
||||
}
|
||||
|
||||
func (m *MockEC2) CreateVpcRequest(*ec2.CreateVpcInput) (*request.Request, *ec2.CreateVpcOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) CreateVpc(request *ec2.CreateVpcInput) (*ec2.CreateVpcOutput, error) {
|
||||
glog.Infof("CreateVpc: %v", request)
|
||||
|
||||
m.vpcNumber++
|
||||
n := m.vpcNumber
|
||||
|
||||
id := fmt.Sprintf("vpc-%d", n)
|
||||
|
||||
vpc := &vpcInfo{
|
||||
main: ec2.Vpc{
|
||||
VpcId: s(id),
|
||||
CidrBlock: request.CidrBlock,
|
||||
},
|
||||
attributes: ec2.DescribeVpcAttributeOutput{
|
||||
EnableDnsHostnames: &ec2.AttributeBooleanValue{Value: aws.Bool(false)},
|
||||
EnableDnsSupport: &ec2.AttributeBooleanValue{Value: aws.Bool(false)},
|
||||
},
|
||||
}
|
||||
|
||||
if m.Vpcs == nil {
|
||||
m.Vpcs = make(map[string]*vpcInfo)
|
||||
}
|
||||
m.Vpcs[id] = vpc
|
||||
|
||||
response := &ec2.CreateVpcOutput{
|
||||
Vpc: &vpc.main,
|
||||
}
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeVpcsRequest(*ec2.DescribeVpcsInput) (*request.Request, *ec2.DescribeVpcsOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeVpcs(request *ec2.DescribeVpcsInput) (*ec2.DescribeVpcsOutput, error) {
|
||||
glog.Infof("DescribeVpcs: %v", request)
|
||||
|
||||
var vpcs []*ec2.Vpc
|
||||
|
||||
for _, vpc := range m.Vpcs {
|
||||
allFiltersMatch := true
|
||||
for _, filter := range request.Filters {
|
||||
match := false
|
||||
switch *filter.Name {
|
||||
|
||||
default:
|
||||
if strings.HasPrefix(*filter.Name, "tag:") {
|
||||
match = m.hasTag(ec2.ResourceTypeVpc, *vpc.main.VpcId, filter)
|
||||
} else {
|
||||
return nil, fmt.Errorf("unknown filter name: %q", *filter.Name)
|
||||
}
|
||||
}
|
||||
|
||||
if !match {
|
||||
allFiltersMatch = false
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if !allFiltersMatch {
|
||||
continue
|
||||
}
|
||||
|
||||
copy := vpc.main
|
||||
copy.Tags = m.getTags(ec2.ResourceTypeVpc, *vpc.main.VpcId)
|
||||
vpcs = append(vpcs, ©)
|
||||
}
|
||||
|
||||
response := &ec2.DescribeVpcsOutput{
|
||||
Vpcs: vpcs,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
||||
|
||||
func (m *MockEC2) DescribeVpcAttributeRequest(*ec2.DescribeVpcAttributeInput) (*request.Request, *ec2.DescribeVpcAttributeOutput) {
|
||||
panic("Not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockEC2) DescribeVpcAttribute(request *ec2.DescribeVpcAttributeInput) (*ec2.DescribeVpcAttributeOutput, error) {
|
||||
glog.Infof("DescribeVpcs: %v", request)
|
||||
|
||||
vpc := m.Vpcs[*request.VpcId]
|
||||
if vpc == nil {
|
||||
return nil, fmt.Errorf("not found")
|
||||
}
|
||||
|
||||
response := &ec2.DescribeVpcAttributeOutput{
|
||||
VpcId: vpc.main.VpcId,
|
||||
|
||||
EnableDnsHostnames: vpc.attributes.EnableDnsHostnames,
|
||||
EnableDnsSupport: vpc.attributes.EnableDnsSupport,
|
||||
}
|
||||
|
||||
return response, nil
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockroute53
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/service/route53/route53iface"
|
||||
)
|
||||
|
||||
type MockRoute53 struct {
|
||||
}
|
||||
|
||||
var _ route53iface.Route53API = &MockRoute53{}
|
|
@ -0,0 +1,419 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package mockroute53
|
||||
|
||||
import (
|
||||
"github.com/aws/aws-sdk-go/aws/request"
|
||||
"github.com/aws/aws-sdk-go/service/route53"
|
||||
)
|
||||
|
||||
func (m *MockRoute53) AssociateVPCWithHostedZoneRequest(*route53.AssociateVPCWithHostedZoneInput) (*request.Request, *route53.AssociateVPCWithHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) AssociateVPCWithHostedZone(*route53.AssociateVPCWithHostedZoneInput) (*route53.AssociateVPCWithHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ChangeResourceRecordSetsRequest(*route53.ChangeResourceRecordSetsInput) (*request.Request, *route53.ChangeResourceRecordSetsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ChangeResourceRecordSets(*route53.ChangeResourceRecordSetsInput) (*route53.ChangeResourceRecordSetsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ChangeTagsForResourceRequest(*route53.ChangeTagsForResourceInput) (*request.Request, *route53.ChangeTagsForResourceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ChangeTagsForResource(*route53.ChangeTagsForResourceInput) (*route53.ChangeTagsForResourceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateHealthCheckRequest(*route53.CreateHealthCheckInput) (*request.Request, *route53.CreateHealthCheckOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateHealthCheck(*route53.CreateHealthCheckInput) (*route53.CreateHealthCheckOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateHostedZoneRequest(*route53.CreateHostedZoneInput) (*request.Request, *route53.CreateHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateHostedZone(*route53.CreateHostedZoneInput) (*route53.CreateHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateReusableDelegationSetRequest(*route53.CreateReusableDelegationSetInput) (*request.Request, *route53.CreateReusableDelegationSetOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateReusableDelegationSet(*route53.CreateReusableDelegationSetInput) (*route53.CreateReusableDelegationSetOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicyRequest(*route53.CreateTrafficPolicyInput) (*request.Request, *route53.CreateTrafficPolicyOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicy(*route53.CreateTrafficPolicyInput) (*route53.CreateTrafficPolicyOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicyInstanceRequest(*route53.CreateTrafficPolicyInstanceInput) (*request.Request, *route53.CreateTrafficPolicyInstanceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicyInstance(*route53.CreateTrafficPolicyInstanceInput) (*route53.CreateTrafficPolicyInstanceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicyVersionRequest(*route53.CreateTrafficPolicyVersionInput) (*request.Request, *route53.CreateTrafficPolicyVersionOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) CreateTrafficPolicyVersion(*route53.CreateTrafficPolicyVersionInput) (*route53.CreateTrafficPolicyVersionOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteHealthCheckRequest(*route53.DeleteHealthCheckInput) (*request.Request, *route53.DeleteHealthCheckOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteHealthCheck(*route53.DeleteHealthCheckInput) (*route53.DeleteHealthCheckOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteHostedZoneRequest(*route53.DeleteHostedZoneInput) (*request.Request, *route53.DeleteHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteHostedZone(*route53.DeleteHostedZoneInput) (*route53.DeleteHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteReusableDelegationSetRequest(*route53.DeleteReusableDelegationSetInput) (*request.Request, *route53.DeleteReusableDelegationSetOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteReusableDelegationSet(*route53.DeleteReusableDelegationSetInput) (*route53.DeleteReusableDelegationSetOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteTrafficPolicyRequest(*route53.DeleteTrafficPolicyInput) (*request.Request, *route53.DeleteTrafficPolicyOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteTrafficPolicy(*route53.DeleteTrafficPolicyInput) (*route53.DeleteTrafficPolicyOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteTrafficPolicyInstanceRequest(*route53.DeleteTrafficPolicyInstanceInput) (*request.Request, *route53.DeleteTrafficPolicyInstanceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DeleteTrafficPolicyInstance(*route53.DeleteTrafficPolicyInstanceInput) (*route53.DeleteTrafficPolicyInstanceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DisassociateVPCFromHostedZoneRequest(*route53.DisassociateVPCFromHostedZoneInput) (*request.Request, *route53.DisassociateVPCFromHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) DisassociateVPCFromHostedZone(*route53.DisassociateVPCFromHostedZoneInput) (*route53.DisassociateVPCFromHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetChangeRequest(*route53.GetChangeInput) (*request.Request, *route53.GetChangeOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetChange(*route53.GetChangeInput) (*route53.GetChangeOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetChangeDetailsRequest(*route53.GetChangeDetailsInput) (*request.Request, *route53.GetChangeDetailsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetChangeDetails(*route53.GetChangeDetailsInput) (*route53.GetChangeDetailsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetCheckerIpRangesRequest(*route53.GetCheckerIpRangesInput) (*request.Request, *route53.GetCheckerIpRangesOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetCheckerIpRanges(*route53.GetCheckerIpRangesInput) (*route53.GetCheckerIpRangesOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetGeoLocationRequest(*route53.GetGeoLocationInput) (*request.Request, *route53.GetGeoLocationOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetGeoLocation(*route53.GetGeoLocationInput) (*route53.GetGeoLocationOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckRequest(*route53.GetHealthCheckInput) (*request.Request, *route53.GetHealthCheckOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheck(*route53.GetHealthCheckInput) (*route53.GetHealthCheckOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckCountRequest(*route53.GetHealthCheckCountInput) (*request.Request, *route53.GetHealthCheckCountOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckCount(*route53.GetHealthCheckCountInput) (*route53.GetHealthCheckCountOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckLastFailureReasonRequest(*route53.GetHealthCheckLastFailureReasonInput) (*request.Request, *route53.GetHealthCheckLastFailureReasonOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckLastFailureReason(*route53.GetHealthCheckLastFailureReasonInput) (*route53.GetHealthCheckLastFailureReasonOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckStatusRequest(*route53.GetHealthCheckStatusInput) (*request.Request, *route53.GetHealthCheckStatusOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHealthCheckStatus(*route53.GetHealthCheckStatusInput) (*route53.GetHealthCheckStatusOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHostedZoneRequest(*route53.GetHostedZoneInput) (*request.Request, *route53.GetHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHostedZone(*route53.GetHostedZoneInput) (*route53.GetHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHostedZoneCountRequest(*route53.GetHostedZoneCountInput) (*request.Request, *route53.GetHostedZoneCountOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetHostedZoneCount(*route53.GetHostedZoneCountInput) (*route53.GetHostedZoneCountOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetReusableDelegationSetRequest(*route53.GetReusableDelegationSetInput) (*request.Request, *route53.GetReusableDelegationSetOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetReusableDelegationSet(*route53.GetReusableDelegationSetInput) (*route53.GetReusableDelegationSetOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicyRequest(*route53.GetTrafficPolicyInput) (*request.Request, *route53.GetTrafficPolicyOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicy(*route53.GetTrafficPolicyInput) (*route53.GetTrafficPolicyOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicyInstanceRequest(*route53.GetTrafficPolicyInstanceInput) (*request.Request, *route53.GetTrafficPolicyInstanceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicyInstance(*route53.GetTrafficPolicyInstanceInput) (*route53.GetTrafficPolicyInstanceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicyInstanceCountRequest(*route53.GetTrafficPolicyInstanceCountInput) (*request.Request, *route53.GetTrafficPolicyInstanceCountOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) GetTrafficPolicyInstanceCount(*route53.GetTrafficPolicyInstanceCountInput) (*route53.GetTrafficPolicyInstanceCountOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListChangeBatchesByHostedZoneRequest(*route53.ListChangeBatchesByHostedZoneInput) (*request.Request, *route53.ListChangeBatchesByHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListChangeBatchesByHostedZone(*route53.ListChangeBatchesByHostedZoneInput) (*route53.ListChangeBatchesByHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListChangeBatchesByRRSetRequest(*route53.ListChangeBatchesByRRSetInput) (*request.Request, *route53.ListChangeBatchesByRRSetOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListChangeBatchesByRRSet(*route53.ListChangeBatchesByRRSetInput) (*route53.ListChangeBatchesByRRSetOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListGeoLocationsRequest(*route53.ListGeoLocationsInput) (*request.Request, *route53.ListGeoLocationsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListGeoLocations(*route53.ListGeoLocationsInput) (*route53.ListGeoLocationsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHealthChecksRequest(*route53.ListHealthChecksInput) (*request.Request, *route53.ListHealthChecksOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHealthChecks(*route53.ListHealthChecksInput) (*route53.ListHealthChecksOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHealthChecksPages(*route53.ListHealthChecksInput, func(*route53.ListHealthChecksOutput, bool) bool) error {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHostedZonesRequest(*route53.ListHostedZonesInput) (*request.Request, *route53.ListHostedZonesOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHostedZones(*route53.ListHostedZonesInput) (*route53.ListHostedZonesOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHostedZonesPages(*route53.ListHostedZonesInput, func(*route53.ListHostedZonesOutput, bool) bool) error {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHostedZonesByNameRequest(*route53.ListHostedZonesByNameInput) (*request.Request, *route53.ListHostedZonesByNameOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListHostedZonesByName(*route53.ListHostedZonesByNameInput) (*route53.ListHostedZonesByNameOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListResourceRecordSetsRequest(*route53.ListResourceRecordSetsInput) (*request.Request, *route53.ListResourceRecordSetsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListResourceRecordSets(*route53.ListResourceRecordSetsInput) (*route53.ListResourceRecordSetsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListResourceRecordSetsPages(*route53.ListResourceRecordSetsInput, func(*route53.ListResourceRecordSetsOutput, bool) bool) error {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListReusableDelegationSetsRequest(*route53.ListReusableDelegationSetsInput) (*request.Request, *route53.ListReusableDelegationSetsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListReusableDelegationSets(*route53.ListReusableDelegationSetsInput) (*route53.ListReusableDelegationSetsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTagsForResourceRequest(*route53.ListTagsForResourceInput) (*request.Request, *route53.ListTagsForResourceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTagsForResource(*route53.ListTagsForResourceInput) (*route53.ListTagsForResourceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTagsForResourcesRequest(*route53.ListTagsForResourcesInput) (*request.Request, *route53.ListTagsForResourcesOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTagsForResources(*route53.ListTagsForResourcesInput) (*route53.ListTagsForResourcesOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPoliciesRequest(*route53.ListTrafficPoliciesInput) (*request.Request, *route53.ListTrafficPoliciesOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicies(*route53.ListTrafficPoliciesInput) (*route53.ListTrafficPoliciesOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstancesRequest(*route53.ListTrafficPolicyInstancesInput) (*request.Request, *route53.ListTrafficPolicyInstancesOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstances(*route53.ListTrafficPolicyInstancesInput) (*route53.ListTrafficPolicyInstancesOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstancesByHostedZoneRequest(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*request.Request, *route53.ListTrafficPolicyInstancesByHostedZoneOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstancesByHostedZone(*route53.ListTrafficPolicyInstancesByHostedZoneInput) (*route53.ListTrafficPolicyInstancesByHostedZoneOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstancesByPolicyRequest(*route53.ListTrafficPolicyInstancesByPolicyInput) (*request.Request, *route53.ListTrafficPolicyInstancesByPolicyOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyInstancesByPolicy(*route53.ListTrafficPolicyInstancesByPolicyInput) (*route53.ListTrafficPolicyInstancesByPolicyOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyVersionsRequest(*route53.ListTrafficPolicyVersionsInput) (*request.Request, *route53.ListTrafficPolicyVersionsOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) ListTrafficPolicyVersions(*route53.ListTrafficPolicyVersionsInput) (*route53.ListTrafficPolicyVersionsOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateHealthCheckRequest(*route53.UpdateHealthCheckInput) (*request.Request, *route53.UpdateHealthCheckOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateHealthCheck(*route53.UpdateHealthCheckInput) (*route53.UpdateHealthCheckOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateHostedZoneCommentRequest(*route53.UpdateHostedZoneCommentInput) (*request.Request, *route53.UpdateHostedZoneCommentOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateHostedZoneComment(*route53.UpdateHostedZoneCommentInput) (*route53.UpdateHostedZoneCommentOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateTrafficPolicyCommentRequest(*route53.UpdateTrafficPolicyCommentInput) (*request.Request, *route53.UpdateTrafficPolicyCommentOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateTrafficPolicyComment(*route53.UpdateTrafficPolicyCommentInput) (*route53.UpdateTrafficPolicyCommentOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateTrafficPolicyInstanceRequest(*route53.UpdateTrafficPolicyInstanceInput) (*request.Request, *route53.UpdateTrafficPolicyInstanceOutput) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
||||
func (m *MockRoute53) UpdateTrafficPolicyInstance(*route53.UpdateTrafficPolicyInstanceInput) (*route53.UpdateTrafficPolicyInstanceOutput, error) {
|
||||
panic("MockRoute53 function not implemented")
|
||||
return nil, nil
|
||||
}
|
|
@ -0,0 +1,118 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package awstasks
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"github.com/aws/aws-sdk-go/service/ec2"
|
||||
"k8s.io/kops/cloudmock/aws/mockec2"
|
||||
"k8s.io/kops/upup/pkg/fi"
|
||||
"k8s.io/kops/upup/pkg/fi/cloudup/awsup"
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
"time"
|
||||
)
|
||||
|
||||
const defaultDeadline = 2 * time.Second
|
||||
|
||||
func TestElasticIPCreate(t *testing.T) {
|
||||
cloud := awsup.BuildMockAWSCloud("us-east-1", "abc")
|
||||
c := &mockec2.MockEC2{}
|
||||
cloud.MockEC2 = c
|
||||
|
||||
// We define a function so we can rebuild the tasks, because we modify in-place when running
|
||||
buildTasks := func() map[string]fi.Task {
|
||||
vpc1 := &VPC{
|
||||
Name: s("vpc1"),
|
||||
CIDR: s("172.20.0.0/16"),
|
||||
}
|
||||
subnet1 := &Subnet{
|
||||
Name: s("subnet1"),
|
||||
VPC: vpc1,
|
||||
CIDR: s("172.20.1.0/24"),
|
||||
}
|
||||
eip1 := &ElasticIP{
|
||||
Name: s("eip1"),
|
||||
Subnet: subnet1,
|
||||
}
|
||||
|
||||
return map[string]fi.Task{
|
||||
"eip1": eip1,
|
||||
"subnet1": subnet1,
|
||||
"vpc1": vpc1,
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
allTasks := buildTasks()
|
||||
eip1 := allTasks["eip1"].(*ElasticIP)
|
||||
|
||||
target := &awsup.AWSAPITarget{
|
||||
Cloud: cloud,
|
||||
}
|
||||
|
||||
context, err := fi.NewContext(target, cloud, nil, nil, nil, true, allTasks)
|
||||
if err != nil {
|
||||
t.Fatalf("error building context: %v", err)
|
||||
}
|
||||
|
||||
if err := context.RunTasks(defaultDeadline); err != nil {
|
||||
t.Fatalf("unexpected error during Run: %v", err)
|
||||
}
|
||||
|
||||
if fi.StringValue(eip1.ID) == "" {
|
||||
t.Fatalf("ID not set after create")
|
||||
}
|
||||
|
||||
if len(c.Addresses) != 1 {
|
||||
t.Fatalf("Expected exactly one ElasticIP; found %v", c.Addresses)
|
||||
}
|
||||
|
||||
expected := &ec2.Address{
|
||||
AllocationId: eip1.ID,
|
||||
Domain: s("vpc"),
|
||||
PublicIp: s("192.0.2.1"),
|
||||
}
|
||||
actual := c.Addresses[0]
|
||||
if !reflect.DeepEqual(actual, expected) {
|
||||
t.Fatalf("Unexpected ElasticIP: expected=%v actual=%v", expected, actual)
|
||||
}
|
||||
}
|
||||
|
||||
{
|
||||
allTasks := buildTasks()
|
||||
|
||||
target := fi.NewDryRunTarget(os.Stderr)
|
||||
context, err := fi.NewContext(target, cloud, nil, nil, nil, true, allTasks)
|
||||
if err != nil {
|
||||
t.Fatalf("error building context: %v", err)
|
||||
}
|
||||
|
||||
if err := context.RunTasks(defaultDeadline); err != nil {
|
||||
t.Fatalf("unexpected error during Run: %v", err)
|
||||
}
|
||||
|
||||
if target.HasChanges() {
|
||||
var b bytes.Buffer
|
||||
if err := target.PrintReport(allTasks, &b); err != nil {
|
||||
t.Fatalf("error building report: %v", err)
|
||||
}
|
||||
t.Fatalf("Target had changes after executing: %v", b.String())
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,22 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors.
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
*/
|
||||
|
||||
package awstasks
|
||||
|
||||
// TODO: Maybe use a static import ("macros")?
|
||||
func s(v string) *string {
|
||||
return &v
|
||||
}
|
|
@ -210,7 +210,11 @@ func isTagsEventualConsistencyError(err error) bool {
|
|||
}
|
||||
|
||||
// GetTags will fetch the tags for the specified resource, retrying (up to MaxDescribeTagsAttempts) if it hits an eventual-consistency type error
|
||||
func (c *awsCloudImplementation) GetTags(resourceId string) (map[string]string, error) {
|
||||
func (c *awsCloudImplementation) GetTags(resourceID string) (map[string]string, error) {
|
||||
return getTags(c, resourceID)
|
||||
}
|
||||
|
||||
func getTags(c AWSCloud, resourceId string) (map[string]string, error) {
|
||||
tags := map[string]string{}
|
||||
|
||||
request := &ec2.DescribeTagsInput{
|
||||
|
@ -256,6 +260,10 @@ func (c *awsCloudImplementation) GetTags(resourceId string) (map[string]string,
|
|||
|
||||
// CreateTags will add tags to the specified resource, retrying up to MaxCreateTagsAttempts times if it hits an eventual-consistency type error
|
||||
func (c *awsCloudImplementation) CreateTags(resourceId string, tags map[string]string) error {
|
||||
return createTags(c, resourceId, tags)
|
||||
}
|
||||
|
||||
func createTags(c AWSCloud, resourceId string, tags map[string]string) error {
|
||||
if len(tags) == 0 {
|
||||
return nil
|
||||
}
|
||||
|
@ -341,6 +349,10 @@ func (c *awsCloudImplementation) DeleteTags(resourceId string, tags map[string]s
|
|||
}
|
||||
|
||||
func (c *awsCloudImplementation) AddAWSTags(id string, expected map[string]string) error {
|
||||
return addAWSTags(c, id, expected)
|
||||
}
|
||||
|
||||
func addAWSTags(c AWSCloud, id string, expected map[string]string) error {
|
||||
actual, err := c.GetTags(id)
|
||||
if err != nil {
|
||||
return fmt.Errorf("unexpected error fetching tags for resource: %v", err)
|
||||
|
@ -423,13 +435,17 @@ func (c *awsCloudImplementation) CreateELBTags(loadBalancerName string, tags map
|
|||
}
|
||||
|
||||
func (c *awsCloudImplementation) BuildTags(name *string) map[string]string {
|
||||
return buildTags(c.tags, name)
|
||||
}
|
||||
|
||||
func buildTags(commonTags map[string]string, name *string) map[string]string {
|
||||
tags := make(map[string]string)
|
||||
if name != nil {
|
||||
tags["Name"] = *name
|
||||
} else {
|
||||
glog.Warningf("Name not set when filtering by name")
|
||||
}
|
||||
for k, v := range c.tags {
|
||||
for k, v := range commonTags {
|
||||
tags[k] = v
|
||||
}
|
||||
return tags
|
||||
|
@ -445,6 +461,10 @@ func (c *awsCloudImplementation) AddTags(name *string, tags map[string]string) {
|
|||
}
|
||||
|
||||
func (c *awsCloudImplementation) BuildFilters(name *string) []*ec2.Filter {
|
||||
return buildFilters(c.tags, name)
|
||||
}
|
||||
|
||||
func buildFilters(commonTags map[string]string, name *string) []*ec2.Filter {
|
||||
filters := []*ec2.Filter{}
|
||||
|
||||
merged := make(map[string]string)
|
||||
|
@ -453,7 +473,7 @@ func (c *awsCloudImplementation) BuildFilters(name *string) []*ec2.Filter {
|
|||
} else {
|
||||
glog.Warningf("Name not set when filtering by name")
|
||||
}
|
||||
for k, v := range c.tags {
|
||||
for k, v := range commonTags {
|
||||
merged[k] = v
|
||||
}
|
||||
|
||||
|
|
|
@ -87,17 +87,15 @@ func (c *MockAWSCloud) AddTags(name *string, tags map[string]string) {
|
|||
}
|
||||
|
||||
func (c *MockAWSCloud) BuildFilters(name *string) []*ec2.Filter {
|
||||
glog.Fatalf("MockAWSCloud BuildFilters not implemented")
|
||||
return nil
|
||||
return buildFilters(c.tags, name)
|
||||
}
|
||||
|
||||
func (c *MockAWSCloud) AddAWSTags(id string, expected map[string]string) error {
|
||||
return fmt.Errorf("MockAWSCloud AddAWSTags not implemented")
|
||||
return addAWSTags(c, id, expected)
|
||||
}
|
||||
|
||||
func (c *MockAWSCloud) BuildTags(name *string) map[string]string {
|
||||
glog.Fatalf("MockAWSCloud BuildTags not implemented")
|
||||
return nil
|
||||
return buildTags(c.tags, name)
|
||||
}
|
||||
|
||||
func (c *MockAWSCloud) Tags() map[string]string {
|
||||
|
@ -106,11 +104,11 @@ func (c *MockAWSCloud) Tags() map[string]string {
|
|||
}
|
||||
|
||||
func (c *MockAWSCloud) CreateTags(resourceId string, tags map[string]string) error {
|
||||
return fmt.Errorf("MockAWSCloud CreateTags not implemented")
|
||||
return createTags(c, resourceId, tags)
|
||||
}
|
||||
|
||||
func (c *MockAWSCloud) GetTags(resourceID string) (map[string]string, error) {
|
||||
return nil, fmt.Errorf("MockAWSCloud GetTags not implemented")
|
||||
return getTags(c, resourceID)
|
||||
}
|
||||
|
||||
func (c *MockAWSCloud) GetELBTags(loadBalancerName string) (map[string]string, error) {
|
||||
|
|
Loading…
Reference in New Issue