diff --git a/Makefile b/Makefile index 9d5072ed47..01e3285bcf 100644 --- a/Makefile +++ b/Makefile @@ -122,6 +122,9 @@ e2e.test: .PHONY: check check: verify-fmt verify-lint vet +.PHONY: develop +develop: aws-cloud-controller-manager test update-fmt check + .PHONY: test test: go test -count=1 -race -v $(shell go list ./...) diff --git a/pkg/providers/v1/aws.go b/pkg/providers/v1/aws.go index dcdf7a2bb3..6b6c7084fe 100644 --- a/pkg/providers/v1/aws.go +++ b/pkg/providers/v1/aws.go @@ -34,7 +34,6 @@ import ( "github.com/aws/aws-sdk-go/aws/endpoints" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/elbv2" @@ -290,7 +289,6 @@ type Services interface { Compute(region string) (iface.EC2, error) LoadBalancing(region string) (ELB, error) LoadBalancingV2(region string) (ELBV2, error) - Autoscaling(region string) (ASG, error) Metadata() (config.EC2Metadata, error) KeyManagement(region string) (KMS, error) } @@ -354,13 +352,6 @@ type ELBV2 interface { WaitUntilLoadBalancersDeleted(*elbv2.DescribeLoadBalancersInput) error } -// ASG is a simple pass-through of the Autoscaling client interface, which -// allows for testing. -type ASG interface { - UpdateAutoScalingGroup(*autoscaling.UpdateAutoScalingGroupInput) (*autoscaling.UpdateAutoScalingGroupOutput, error) - DescribeAutoScalingGroups(*autoscaling.DescribeAutoScalingGroupsInput) (*autoscaling.DescribeAutoScalingGroupsOutput, error) -} - // KMS is a simple pass-through of the Key Management Service client interface, // which allows for testing. type KMS interface { @@ -378,7 +369,6 @@ type Cloud struct { ec2 iface.EC2 elb ELB elbv2 ELBV2 - asg ASG kms KMS metadata config.EC2Metadata cfg *config.CloudConfig @@ -604,11 +594,6 @@ func newAWSCloud2(cfg config.CloudConfig, awsServices Services, provider config. return nil, fmt.Errorf("error creating AWS ELBV2 client: %v", err) } - asg, err := awsServices.Autoscaling(regionName) - if err != nil { - return nil, fmt.Errorf("error creating AWS autoscaling client: %v", err) - } - kms, err := awsServices.KeyManagement(regionName) if err != nil { return nil, fmt.Errorf("error creating AWS key management client: %v", err) @@ -618,7 +603,6 @@ func newAWSCloud2(cfg config.CloudConfig, awsServices Services, provider config. ec2: ec2, elb: elb, elbv2: elbv2, - asg: asg, metadata: metadata, kms: kms, cfg: &cfg, diff --git a/pkg/providers/v1/aws_fakes.go b/pkg/providers/v1/aws_fakes.go index 2e4525d4bc..7e1a0e4579 100644 --- a/pkg/providers/v1/aws_fakes.go +++ b/pkg/providers/v1/aws_fakes.go @@ -168,11 +168,6 @@ func (s *FakeAWSServices) LoadBalancingV2(region string) (ELBV2, error) { return s.elbv2, nil } -// Autoscaling returns a fake ASG client -func (s *FakeAWSServices) Autoscaling(region string) (ASG, error) { - return s.asg, nil -} - // Metadata returns a fake EC2Metadata client func (s *FakeAWSServices) Metadata() (config.EC2Metadata, error) { return s.metadata, nil diff --git a/pkg/providers/v1/aws_sdk.go b/pkg/providers/v1/aws_sdk.go index 4f2d18a2dd..bc41b4cbbc 100644 --- a/pkg/providers/v1/aws_sdk.go +++ b/pkg/providers/v1/aws_sdk.go @@ -25,7 +25,6 @@ import ( "github.com/aws/aws-sdk-go/aws/ec2metadata" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" - "github.com/aws/aws-sdk-go/service/autoscaling" "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/elbv2" @@ -179,27 +178,6 @@ func (p *awsSDKProvider) LoadBalancingV2(regionName string) (ELBV2, error) { return elbClient, nil } -func (p *awsSDKProvider) Autoscaling(regionName string) (ASG, error) { - awsConfig := &aws.Config{ - Region: ®ionName, - Credentials: p.creds, - } - awsConfig = awsConfig.WithCredentialsChainVerboseErrors(true). - WithEndpointResolver(p.cfg.GetResolver()) - sess, err := session.NewSessionWithOptions(session.Options{ - Config: *awsConfig, - SharedConfigState: session.SharedConfigEnable, - }) - if err != nil { - return nil, fmt.Errorf("unable to initialize AWS session: %v", err) - } - client := autoscaling.New(sess) - - p.AddHandlers(regionName, &client.Handlers) - - return client, nil -} - func (p *awsSDKProvider) Metadata() (config.EC2Metadata, error) { sess, err := session.NewSession(&aws.Config{ EndpointResolver: p.cfg.GetResolver(),