From 0a158cabd390997dd02a5ebe493ed043f0e5fc99 Mon Sep 17 00:00:00 2001 From: Jan Chaloupka Date: Sun, 23 Dec 2018 14:43:30 +0100 Subject: [PATCH] Move pkg/cloud/aws/client under pkg/client The client is not actuatlly aws client, rather a wrapper built on top of aws services. Thus, no need to mention cloud or aws in the package path. --- cmd/aws-actuator/main.go | 2 +- cmd/aws-actuator/utils/utils.go | 2 +- cmd/manager/main.go | 2 +- pkg/actuators/machine/actuator.go | 2 +- pkg/actuators/machine/actuator_test.go | 4 ++-- pkg/actuators/machine/awsclient.go | 2 +- pkg/actuators/machine/awsclient_test.go | 2 +- pkg/actuators/machine/instaces_test.go | 2 +- pkg/actuators/machine/instances.go | 2 +- pkg/actuators/machine/loadbalancers.go | 2 +- pkg/actuators/machine/loadbalancers_test.go | 2 +- pkg/actuators/machine/utils.go | 2 +- pkg/{cloud/aws => }/client/client.go | 0 pkg/{cloud/aws => }/client/fake/fake.go | 2 +- pkg/{cloud/aws => }/client/mock/client_generated.go | 0 test/integration/create_update_delete_test.go | 2 +- test/machines/machines_test.go | 2 +- test/utils/manifests.go | 2 +- 18 files changed, 17 insertions(+), 17 deletions(-) rename pkg/{cloud/aws => }/client/client.go (100%) rename pkg/{cloud/aws => }/client/fake/fake.go (98%) rename pkg/{cloud/aws => }/client/mock/client_generated.go (100%) diff --git a/cmd/aws-actuator/main.go b/cmd/aws-actuator/main.go index c47eb22510..b2bf6ba836 100644 --- a/cmd/aws-actuator/main.go +++ b/cmd/aws-actuator/main.go @@ -37,7 +37,7 @@ import ( "github.com/golang/glog" "github.com/spf13/cobra" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/ghodss/yaml" diff --git a/cmd/aws-actuator/utils/utils.go b/cmd/aws-actuator/utils/utils.go index e7df103f7b..d392b05cf8 100644 --- a/cmd/aws-actuator/utils/utils.go +++ b/cmd/aws-actuator/utils/utils.go @@ -3,7 +3,7 @@ package utils import ( "github.com/golang/glog" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" apiv1 "k8s.io/api/core/v1" diff --git a/cmd/manager/main.go b/cmd/manager/main.go index 91d1a3d107..f19e0b720d 100644 --- a/cmd/manager/main.go +++ b/cmd/manager/main.go @@ -21,7 +21,7 @@ import ( machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis" "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" "sigs.k8s.io/cluster-api-provider-aws/pkg/controller" clusterapis "sigs.k8s.io/cluster-api/pkg/apis" "sigs.k8s.io/controller-runtime/pkg/client/config" diff --git a/pkg/actuators/machine/actuator.go b/pkg/actuators/machine/actuator.go index 445d3d1807..e098b27190 100644 --- a/pkg/actuators/machine/actuator.go +++ b/pkg/actuators/machine/actuator.go @@ -36,7 +36,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/actuators/machine/actuator_test.go b/pkg/actuators/machine/actuator_test.go index 3f3094f67a..6e5400a35e 100644 --- a/pkg/actuators/machine/actuator_test.go +++ b/pkg/actuators/machine/actuator_test.go @@ -15,8 +15,8 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" - mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client/mock" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" + mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/client/mock" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "k8s.io/apimachinery/pkg/types" diff --git a/pkg/actuators/machine/awsclient.go b/pkg/actuators/machine/awsclient.go index ea8a2ca34b..d8d7dfdfa1 100644 --- a/pkg/actuators/machine/awsclient.go +++ b/pkg/actuators/machine/awsclient.go @@ -5,7 +5,7 @@ import ( "github.com/openshift/cluster-api-actuator-pkg/pkg/types" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" ) diff --git a/pkg/actuators/machine/awsclient_test.go b/pkg/actuators/machine/awsclient_test.go index 129d11a7c5..39a36fde5c 100644 --- a/pkg/actuators/machine/awsclient_test.go +++ b/pkg/actuators/machine/awsclient_test.go @@ -10,7 +10,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" "github.com/golang/mock/gomock" - mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client/mock" + mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/client/mock" ) func TestAwsClient(t *testing.T) { diff --git a/pkg/actuators/machine/instaces_test.go b/pkg/actuators/machine/instaces_test.go index 2cd5a8db98..cd1cbf5ee9 100644 --- a/pkg/actuators/machine/instaces_test.go +++ b/pkg/actuators/machine/instaces_test.go @@ -11,7 +11,7 @@ import ( providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" "github.com/golang/mock/gomock" - mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client/mock" + mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/client/mock" ) func TestRemoveDuplicatedTags(t *testing.T) { diff --git a/pkg/actuators/machine/instances.go b/pkg/actuators/machine/instances.go index fdc3846e70..9c3055b967 100644 --- a/pkg/actuators/machine/instances.go +++ b/pkg/actuators/machine/instances.go @@ -14,7 +14,7 @@ import ( "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/service/ec2" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" ) // Scan machine tags, and return a deduped tags list diff --git a/pkg/actuators/machine/loadbalancers.go b/pkg/actuators/machine/loadbalancers.go index 95a84719c9..e58db18ca0 100644 --- a/pkg/actuators/machine/loadbalancers.go +++ b/pkg/actuators/machine/loadbalancers.go @@ -13,7 +13,7 @@ import ( "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/elbv2" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" ) func registerWithClassicLoadBalancers(client awsclient.Client, names []string, instance *ec2.Instance) error { diff --git a/pkg/actuators/machine/loadbalancers_test.go b/pkg/actuators/machine/loadbalancers_test.go index 6ee6e4e777..533a2ada9f 100644 --- a/pkg/actuators/machine/loadbalancers_test.go +++ b/pkg/actuators/machine/loadbalancers_test.go @@ -5,7 +5,7 @@ import ( "testing" "github.com/golang/mock/gomock" - mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client/mock" + mockaws "sigs.k8s.io/cluster-api-provider-aws/pkg/client/mock" ) func TestRegisterWithNetworkLoadBalancers(t *testing.T) { diff --git a/pkg/actuators/machine/utils.go b/pkg/actuators/machine/utils.go index 83c9b67cee..269daa27ad 100644 --- a/pkg/actuators/machine/utils.go +++ b/pkg/actuators/machine/utils.go @@ -30,7 +30,7 @@ import ( "golang.org/x/net/context" "k8s.io/apimachinery/pkg/types" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "sigs.k8s.io/controller-runtime/pkg/client" ) diff --git a/pkg/cloud/aws/client/client.go b/pkg/client/client.go similarity index 100% rename from pkg/cloud/aws/client/client.go rename to pkg/client/client.go diff --git a/pkg/cloud/aws/client/fake/fake.go b/pkg/client/fake/fake.go similarity index 98% rename from pkg/cloud/aws/client/fake/fake.go rename to pkg/client/fake/fake.go index 49fa7f395d..9831f90312 100644 --- a/pkg/cloud/aws/client/fake/fake.go +++ b/pkg/client/fake/fake.go @@ -8,7 +8,7 @@ import ( "github.com/aws/aws-sdk-go/service/elb" "github.com/aws/aws-sdk-go/service/elbv2" "k8s.io/client-go/kubernetes" - "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + "sigs.k8s.io/cluster-api-provider-aws/pkg/client" ) type awsClient struct { diff --git a/pkg/cloud/aws/client/mock/client_generated.go b/pkg/client/mock/client_generated.go similarity index 100% rename from pkg/cloud/aws/client/mock/client_generated.go rename to pkg/client/mock/client_generated.go diff --git a/test/integration/create_update_delete_test.go b/test/integration/create_update_delete_test.go index 88002c7996..92f1b6933d 100644 --- a/test/integration/create_update_delete_test.go +++ b/test/integration/create_update_delete_test.go @@ -15,7 +15,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" machineactuator "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" "github.com/ghodss/yaml" diff --git a/test/machines/machines_test.go b/test/machines/machines_test.go index ee4eb351f8..c55bdd3d64 100644 --- a/test/machines/machines_test.go +++ b/test/machines/machines_test.go @@ -25,7 +25,7 @@ import ( "github.com/aws/aws-sdk-go/service/ec2" machineutils "sigs.k8s.io/cluster-api-provider-aws/pkg/actuators/machine" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" ) const ( diff --git a/test/utils/manifests.go b/test/utils/manifests.go index c7867f25a8..10955aa63e 100644 --- a/test/utils/manifests.go +++ b/test/utils/manifests.go @@ -7,7 +7,7 @@ import ( apiv1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" providerconfigv1 "sigs.k8s.io/cluster-api-provider-aws/pkg/apis/awsproviderconfig/v1alpha1" - awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/cloud/aws/client" + awsclient "sigs.k8s.io/cluster-api-provider-aws/pkg/client" clusterv1alpha1 "sigs.k8s.io/cluster-api/pkg/apis/cluster/v1alpha1" )