From 5e2d8dd4aaf166a86880ad8ca1bcb0686d74caec Mon Sep 17 00:00:00 2001 From: "Maximilian Blatt (external expert on behalf of DB Netz)" Date: Fri, 6 Oct 2023 19:14:06 +0200 Subject: [PATCH] chore: Update build system * Use Go v1.21.2 ** Add ignore opts to some tests because they failed due to the unexported context.backgroundCtx struct * Bump golangci-lint to v1.54.0 * Bump build submodule Copy (most of) .golancilint.yml from github.com/crossplane/crossplane and fix the linter issues accordingly. Go import order is now 1. Go standard packages 2. 3rd party packages 3. local packages Signed-off-by: Maximilian Blatt (external expert on behalf of DB Netz) Co-authored-by: ivan katliarchuk --- .github/workflows/ci.yml | 182 +++++++++++++----- .golangci.yml | 44 +++-- CODE_GENERATION.md | 1 - Makefile | 1 + apis/apigatewayv2/v1alpha1/referencers.go | 4 +- apis/batch/manualv1alpha1/job.go | 3 +- apis/batch/manualv1alpha1/jobdefinition.go | 3 +- apis/cache/v1alpha1/cachecluster_types.go | 3 +- apis/cache/v1beta1/referencers.go | 3 +- apis/cache/v1beta1/replication_group_types.go | 3 +- .../groupusermembership_types.go | 3 +- apis/database/v1beta1/dbsubnetgroup_types.go | 3 +- apis/database/v1beta1/rdsinstance_types.go | 3 +- apis/docdb/v1alpha1/referencers.go | 3 +- apis/dynamodb/v1alpha1/referencers.go | 3 +- .../manualv1alpha1/securitygrouprule_types.go | 1 - apis/ec2/manualv1alpha1/vpccidrblock_types.go | 3 +- apis/ec2/v1beta1/address_types.go | 3 +- apis/ec2/v1beta1/internetgateway_types.go | 3 +- apis/ec2/v1beta1/natgateway_types.go | 3 +- apis/ec2/v1beta1/routetable_types.go | 3 +- apis/ec2/v1beta1/securitygroup_types.go | 3 +- apis/ec2/v1beta1/subnet_types.go | 3 +- apis/ec2/v1beta1/vpc_types.go | 3 +- apis/ec2/v1beta1/vpccidrblock_types.go | 3 +- apis/ecr/v1alpha1/policy_types.go | 3 +- apis/ecr/v1alpha1/repository_types.go | 3 +- apis/ecr/v1beta1/policy_types.go | 3 +- apis/ecr/v1beta1/referencers.go | 3 +- apis/ecr/v1beta1/repository_types.go | 3 +- apis/efs/v1alpha1/referencers.go | 3 +- .../manualv1alpha1/fargate_profile_types.go | 3 +- apis/eks/manualv1alpha1/nodegroup_types.go | 3 +- apis/eks/v1beta1/fargate_profile_types.go | 3 +- apis/eks/v1beta1/types.go | 3 +- .../v1alpha1/elb_types.go | 3 +- .../v1alpha1/referencers.go | 3 +- apis/iam/v1beta1/accesskey_types.go | 3 +- apis/iam/v1beta1/group_types.go | 3 +- .../v1beta1/grouppolicyattachment_types.go | 3 +- apis/iam/v1beta1/groupusermembership_types.go | 3 +- apis/iam/v1beta1/policy_types.go | 3 +- apis/iam/v1beta1/role_types.go | 3 +- .../iam/v1beta1/rolepolicyattachment_types.go | 3 +- apis/iam/v1beta1/user_types.go | 3 +- .../iam/v1beta1/userpolicyattachment_types.go | 3 +- apis/lambda/manualv1alpha1/permission.go | 5 +- apis/lambda/v1alpha1/referencers.go | 9 +- apis/lambda/v1beta1/referencers.go | 11 +- apis/rds/v1alpha1/referencers.go | 9 +- apis/redshift/v1alpha1/redshift_types.go | 3 +- apis/redshift/v1alpha1/referencers.go | 3 +- apis/route53/v1alpha1/hostedzone_types.go | 3 +- apis/route53/v1alpha1/referencers.go | 3 +- .../v1alpha1/resourcerecordset_types.go | 3 +- .../resolverruleassociation_types.go | 3 +- apis/route53resolver/v1alpha1/referencers.go | 1 - apis/s3/common/bucketpolicy_types.go | 3 +- apis/s3/v1alpha3/bucketpolicy_types.go | 3 +- apis/secretsmanager/v1alpha1/referencers.go | 3 +- apis/secretsmanager/v1beta1/referencers.go | 3 +- apis/servicediscovery/v1alpha1/referencers.go | 3 +- apis/sfn/v1alpha1/referencers.go | 3 +- apis/sns/v1beta1/referencers.go | 5 +- apis/sns/v1beta1/subscription_types.go | 1 - apis/sns/v1beta1/topic_types.go | 3 +- apis/sqs/v1beta1/queue_types.go | 3 +- apis/v1alpha1/storeconfig_types.go | 3 +- apis/v1beta1/providerconfig_types.go | 3 +- build | 2 +- cmd/provider/main.go | 13 +- go.mod | 2 +- go.sum | 13 ++ pkg/clients/acm/certificate.go | 7 +- pkg/clients/acm/certificate_test.go | 9 +- pkg/clients/acmpca/certificateauthority.go | 6 +- pkg/clients/cloudsearch/fake/cloudsearch.go | 3 +- .../cognitoidentityprovider.go | 3 +- .../groupusermembership.go | 7 +- pkg/clients/config.go | 16 +- pkg/clients/config_test.go | 7 +- pkg/clients/database/rds.go | 15 +- pkg/clients/database/rds_test.go | 12 +- pkg/clients/dbsubnetgroup/dbsubnetgroup.go | 2 +- pkg/clients/ec2/address.go | 2 +- pkg/clients/ec2/ec2_test.go | 3 +- pkg/clients/ec2/instance.go | 2 +- pkg/clients/ec2/instance_test.go | 3 +- pkg/clients/ec2/internetgateway.go | 2 +- pkg/clients/ec2/natgateway.go | 1 - pkg/clients/ec2/routetable.go | 5 +- pkg/clients/ec2/securitygroup.go | 2 +- pkg/clients/ec2/securitygroup_diff.go | 2 +- pkg/clients/ec2/subnet.go | 2 +- pkg/clients/ec2/tags.go | 1 - pkg/clients/ec2/vpc.go | 2 +- pkg/clients/ecr/repository.go | 2 +- pkg/clients/ecr/repository_policy.go | 4 +- pkg/clients/ecr/repository_test.go | 6 +- pkg/clients/eks/eks.go | 13 +- pkg/clients/eks/eks_test.go | 8 +- pkg/clients/eks/fargateprofile.go | 6 +- pkg/clients/eks/fargateprofile_test.go | 9 +- pkg/clients/eks/identityproviderconfig.go | 4 +- pkg/clients/eks/nodegroup.go | 6 +- pkg/clients/eks/nodegroup_test.go | 5 +- pkg/clients/elasticache/elasticache.go | 14 +- pkg/clients/elasticache/elasticache_test.go | 7 +- .../elasticache/elasticcachecluster_test.go | 5 +- pkg/clients/elasticloadbalancing/elb/elb.go | 5 +- .../elasticloadbalancing/elb/elb_test.go | 5 +- pkg/clients/error_test.go | 3 +- pkg/clients/iam/group.go | 1 - pkg/clients/iam/grouppolicyattachment.go | 1 - pkg/clients/iam/groupusermembership.go | 1 - pkg/clients/iam/iam.go | 4 +- pkg/clients/iam/openidconnectprovider.go | 4 +- pkg/clients/iam/openidconnectprovider_test.go | 3 +- pkg/clients/iam/policy.go | 3 +- pkg/clients/iam/role.go | 6 +- pkg/clients/iam/role_test.go | 3 +- pkg/clients/iam/tags_test.go | 3 +- pkg/clients/iam/user_test.go | 4 +- pkg/clients/iam/userpolicyattachment.go | 1 - pkg/clients/mq/mq.go | 5 +- pkg/clients/mq/mq_test.go | 5 +- pkg/clients/pointer.go | 1 - pkg/clients/rds/common.go | 3 +- pkg/clients/redshift/redshift.go | 12 +- pkg/clients/redshift/redshift_test.go | 5 +- .../resolverruleassociation.go | 3 +- .../resourcerecordset/resourcerecordset.go | 6 +- pkg/clients/s3/bucket.go | 4 +- pkg/clients/s3/bucketpolicy.go | 2 +- pkg/clients/s3/fake/bucket.go | 8 +- pkg/clients/servicediscovery/fake/fake.go | 46 ++--- pkg/clients/sns/subscription.go | 6 +- pkg/clients/sns/topic.go | 8 +- pkg/clients/sns/topic_test.go | 8 +- pkg/clients/sqs/queue.go | 10 +- pkg/clients/sqs/queue_test.go | 3 +- pkg/clients/tags_test.go | 3 +- pkg/controller/acm/controller.go | 11 +- pkg/controller/acm/controller_test.go | 5 +- pkg/controller/acm/setup.go | 3 +- .../acmpca/certificateauthority/controller.go | 13 +- .../certificateauthority/controller_test.go | 14 +- .../controller.go | 7 +- .../controller_test.go | 5 +- pkg/controller/acmpca/setup.go | 3 +- pkg/controller/apigateway/setup.go | 3 +- pkg/controller/apigatewayv2/api/setup.go | 6 +- .../apigatewayv2/apimapping/setup.go | 6 +- .../apigatewayv2/authorizer/setup.go | 3 +- .../apigatewayv2/deployment/setup.go | 3 +- .../apigatewayv2/domainname/setup.go | 3 +- .../apigatewayv2/integration/setup.go | 3 +- .../apigatewayv2/integrationresponse/setup.go | 3 +- pkg/controller/apigatewayv2/model/setup.go | 3 +- pkg/controller/apigatewayv2/route/setup.go | 3 +- .../apigatewayv2/routeresponse/setup.go | 3 +- pkg/controller/apigatewayv2/setup.go | 3 +- pkg/controller/apigatewayv2/stage/setup.go | 3 +- pkg/controller/apigatewayv2/vpclink/setup.go | 3 +- pkg/controller/athena/setup.go | 3 +- pkg/controller/athena/workgroup/setup.go | 8 +- .../autoscaling/autoscalinggroup/setup.go | 5 +- pkg/controller/autoscaling/setup.go | 3 +- pkg/controller/aws.go | 3 +- .../batch/computeenvironment/setup.go | 9 +- pkg/controller/batch/job/controller.go | 13 +- pkg/controller/batch/job/conversion.go | 5 +- .../batch/jobdefinition/controller.go | 11 +- .../batch/jobdefinition/conversion.go | 15 +- pkg/controller/batch/jobqueue/setup.go | 7 +- pkg/controller/batch/setup.go | 3 +- .../cache/cachesubnetgroup/controller.go | 7 +- .../cache/cachesubnetgroup/controller_test.go | 5 +- pkg/controller/cache/cluster/controller.go | 7 +- .../cache/cluster/controller_test.go | 5 +- .../cache/replicationgroup/managed.go | 11 +- .../cache/replicationgroup/managed_test.go | 11 +- pkg/controller/cache/setup.go | 3 +- .../cloudfront/distribution/setup.go | 7 +- .../cloudfront/responseheaderspolicy/setup.go | 3 +- pkg/controller/cloudfront/setup.go | 3 +- pkg/controller/cloudfront/utils/lateinit.go | 10 +- .../cloudfront/utils/lateinit_test.go | 10 +- pkg/controller/cloudsearch/domain/setup.go | 5 +- .../cloudsearch/domain/setup_test.go | 5 +- pkg/controller/cloudsearch/setup.go | 3 +- .../cloudwatchlogs/loggroup/setup.go | 7 +- pkg/controller/cloudwatchlogs/setup.go | 3 +- .../cognitoidentity/identitypool/setup.go | 5 +- pkg/controller/cognitoidentity/setup.go | 3 +- .../cognitoidentityprovider/group/setup.go | 5 +- .../groupusermembership/controller.go | 7 +- .../groupusermembership/controller_test.go | 8 +- .../identityprovider/setup.go | 7 +- .../resourceserver/setup.go | 5 +- .../cognitoidentityprovider/setup.go | 3 +- .../cognitoidentityprovider/userpool/setup.go | 7 +- .../userpoolclient/setup.go | 5 +- .../userpooldomain/setup.go | 5 +- pkg/controller/config/config.go | 3 +- .../database/dbsubnetgroup/controller.go | 10 +- .../database/dbsubnetgroup/controller_test.go | 7 +- .../database/rdsinstance/rdsinstance.go | 13 +- .../database/rdsinstance/rdsinstance_test.go | 18 +- pkg/controller/database/setup.go | 3 +- pkg/controller/dax/cluster/setup.go | 7 +- pkg/controller/dax/cluster/setup_test.go | 17 +- pkg/controller/dax/parametergroup/setup.go | 3 +- .../dax/parametergroup/setup_test.go | 16 +- pkg/controller/dax/setup.go | 3 +- pkg/controller/dax/subnetgroup/setup_test.go | 17 +- pkg/controller/docdb/dbcluster/setup.go | 22 +-- pkg/controller/docdb/dbcluster/setup_test.go | 23 ++- .../docdb/dbclusterparametergroup/setup.go | 11 +- .../dbclusterparametergroup/setup_test.go | 17 +- pkg/controller/docdb/dbinstance/setup.go | 9 +- pkg/controller/docdb/dbinstance/setup_test.go | 17 +- pkg/controller/docdb/dbsubnetgroup/setup.go | 7 +- .../docdb/dbsubnetgroup/setup_test.go | 17 +- pkg/controller/docdb/setup.go | 3 +- pkg/controller/dynamodb/backup/hooks.go | 3 +- pkg/controller/dynamodb/globaltable/hooks.go | 7 +- pkg/controller/dynamodb/setup.go | 3 +- pkg/controller/dynamodb/table/hooks.go | 15 +- pkg/controller/ec2/address/controller.go | 11 +- pkg/controller/ec2/address/controller_test.go | 12 +- pkg/controller/ec2/flowlog/setup.go | 15 +- pkg/controller/ec2/instance/controller.go | 13 +- .../ec2/instance/controller_test.go | 16 +- .../ec2/internetgateway/controller.go | 9 +- .../ec2/internetgateway/controller_test.go | 7 +- pkg/controller/ec2/launchtemplate/setup.go | 7 +- .../ec2/launchtemplateversion/setup.go | 3 +- pkg/controller/ec2/natgateway/controller.go | 7 +- .../ec2/natgateway/controller_test.go | 9 +- pkg/controller/ec2/route/setup.go | 7 +- pkg/controller/ec2/routetable/controller.go | 19 +- .../ec2/routetable/controller_test.go | 7 +- .../ec2/securitygroup/controller.go | 17 +- .../ec2/securitygroup/controller_test.go | 12 +- .../ec2/securitygrouprule/controller.go | 15 +- .../ec2/securitygrouprule/controller_test.go | 11 +- pkg/controller/ec2/setup.go | 3 +- pkg/controller/ec2/subnet/controller.go | 13 +- pkg/controller/ec2/subnet/controller_test.go | 7 +- pkg/controller/ec2/transitgateway/setup.go | 10 +- .../ec2/transitgatewayroute/setup.go | 9 +- .../ec2/transitgatewayroutetable/setup.go | 7 +- .../ec2/transitgatewayvpcattachment/setup.go | 7 +- pkg/controller/ec2/volume/setup.go | 3 +- pkg/controller/ec2/vpc/controller.go | 13 +- pkg/controller/ec2/vpc/controller_test.go | 14 +- pkg/controller/ec2/vpccidrblock/controller.go | 9 +- .../ec2/vpccidrblock/controller_test.go | 7 +- pkg/controller/ec2/vpcendpoint/setup.go | 9 +- pkg/controller/ec2/vpcendpoint/setup_test.go | 6 +- .../vpcendpointserviceconfiguration/setup.go | 9 +- .../setup_test.go | 1 - .../ec2/vpcpeeringconnection/setup.go | 9 +- .../ec2/vpcpeeringconnection/setup_test.go | 1 - pkg/controller/ecr/lifecyclepolicy/setup.go | 7 +- pkg/controller/ecr/repository/controller.go | 9 +- .../ecr/repository/controller_test.go | 13 +- .../ecr/repositorypolicy/controller.go | 9 +- .../ecr/repositorypolicy/controller_test.go | 11 +- pkg/controller/ecr/setup.go | 3 +- pkg/controller/ecs/cluster/setup.go | 3 +- pkg/controller/ecs/service/setup.go | 4 +- pkg/controller/ecs/service/setup_test.go | 4 +- pkg/controller/ecs/setup.go | 3 +- pkg/controller/ecs/taskdefinition/setup.go | 6 +- .../ecs/taskdefinition/setup_test.go | 3 +- pkg/controller/efs/accesspoint/setup.go | 8 +- pkg/controller/efs/filesystem/setup.go | 3 +- pkg/controller/efs/mounttarget/setup.go | 3 +- pkg/controller/efs/setup.go | 3 +- pkg/controller/eks/addon/setup.go | 11 +- pkg/controller/eks/addon/setup_test.go | 8 +- pkg/controller/eks/cluster/cluster.go | 9 +- pkg/controller/eks/cluster/cluster_test.go | 7 +- .../eks/fargateprofile/controller.go | 11 +- .../eks/fargateprofile/controller_test.go | 14 +- .../eks/identityproviderconfig/controller.go | 11 +- .../identityproviderconfig/controller_test.go | 3 +- pkg/controller/eks/nodegroup/controller.go | 11 +- .../eks/nodegroup/controller_test.go | 7 +- pkg/controller/eks/setup.go | 3 +- .../elasticache/cacheparametergroup/setup.go | 9 +- .../cacheparametergroup/setup_test.go | 4 +- pkg/controller/elasticache/setup.go | 3 +- .../elasticloadbalancing/elb/controller.go | 13 +- .../elb/controller_test.go | 10 +- .../elbattachment/controller.go | 9 +- .../elbattachment/controller_test.go | 8 +- pkg/controller/elasticloadbalancing/setup.go | 3 +- pkg/controller/elbv2/listener/setup.go | 3 +- pkg/controller/elbv2/listener/setup_test.go | 3 +- pkg/controller/elbv2/loadbalancer/setup.go | 3 +- pkg/controller/elbv2/setup.go | 3 +- pkg/controller/elbv2/target/controller.go | 7 +- pkg/controller/elbv2/targetgroup/setup.go | 3 +- pkg/controller/emrcontainers/setup.go | 3 +- .../globalaccelerator/accelerator/setup.go | 3 +- .../globalaccelerator/listener/setup.go | 3 +- pkg/controller/globalaccelerator/setup.go | 3 +- pkg/controller/glue/classifier/setup.go | 9 +- pkg/controller/glue/connection/setup.go | 11 +- pkg/controller/glue/crawler/setup.go | 25 +-- pkg/controller/glue/database/setup.go | 9 +- pkg/controller/glue/job/setup.go | 11 +- .../glue/securityconfiguration/setup.go | 5 +- pkg/controller/glue/setup.go | 3 +- pkg/controller/iam/accesskey/controller.go | 7 +- .../iam/accesskey/controller_test.go | 7 +- pkg/controller/iam/group/controller.go | 7 +- pkg/controller/iam/group/controller_test.go | 5 +- .../iam/grouppolicyattachment/controller.go | 7 +- .../grouppolicyattachment/controller_test.go | 8 +- .../iam/groupusermembership/controller.go | 7 +- .../groupusermembership/controller_test.go | 8 +- pkg/controller/iam/instanceprofile/setup.go | 3 +- .../iam/openidconnectprovider/controller.go | 13 +- .../openidconnectprovider/controller_test.go | 14 +- pkg/controller/iam/policy/controller.go | 9 +- pkg/controller/iam/policy/controller_test.go | 15 +- pkg/controller/iam/role/controller.go | 11 +- pkg/controller/iam/role/controller_test.go | 7 +- .../iam/rolepolicyattachment/controller.go | 7 +- .../rolepolicyattachment/controller_test.go | 5 +- pkg/controller/iam/servicelinkedrole/setup.go | 5 +- pkg/controller/iam/setup.go | 3 +- pkg/controller/iam/user/controller.go | 10 +- pkg/controller/iam/user/controller_test.go | 11 +- .../iam/userpolicyattachment/controller.go | 7 +- .../userpolicyattachment/controller_test.go | 8 +- pkg/controller/iot/policy/setup.go | 3 +- pkg/controller/iot/setup.go | 3 +- pkg/controller/iot/thing/setup.go | 5 +- pkg/controller/iot/thing/setup_test.go | 3 +- pkg/controller/kafka/cluster/setup.go | 25 ++- pkg/controller/kafka/configuration/setup.go | 7 +- pkg/controller/kafka/setup.go | 3 +- pkg/controller/kinesis/setup.go | 3 +- pkg/controller/kinesis/stream/setup.go | 11 +- pkg/controller/kms/alias/controller.go | 7 +- pkg/controller/kms/alias/setup.go | 7 +- pkg/controller/kms/key/setup.go | 7 +- pkg/controller/kms/setup.go | 3 +- pkg/controller/lambda/function/setup.go | 16 +- pkg/controller/lambda/function/setup_test.go | 3 +- .../lambda/functionurlconfig/setup.go | 11 +- .../lambda/permission/controller.go | 11 +- .../lambda/permission/conversion.go | 1 - pkg/controller/lambda/setup.go | 3 +- pkg/controller/mq/broker/setup.go | 14 +- pkg/controller/mq/setup.go | 3 +- pkg/controller/mq/user/setup.go | 7 +- pkg/controller/mwaa/environment/setup.go | 5 +- pkg/controller/mwaa/setup.go | 3 +- pkg/controller/neptune/dbcluster/setup.go | 9 +- pkg/controller/neptune/setup.go | 3 +- .../opensearchservice/domain/setup.go | 17 +- pkg/controller/opensearchservice/setup.go | 3 +- .../alertmanagerdefinition/setup.go | 3 +- .../rulegroupsnamespace/setup.go | 5 +- pkg/controller/prometheusservice/setup.go | 3 +- .../prometheusservice/workspace/setup.go | 7 +- pkg/controller/ram/resourceshare/setup.go | 7 +- pkg/controller/ram/setup.go | 3 +- pkg/controller/rds/dbcluster/setup.go | 34 ++-- pkg/controller/rds/dbcluster/setup_test.go | 3 +- .../rds/dbclusterparametergroup/setup.go | 8 +- pkg/controller/rds/dbinstance/setup.go | 17 +- .../rds/dbinstanceroleassociation/setup.go | 5 +- pkg/controller/rds/dbparametergroup/setup.go | 7 +- pkg/controller/rds/globalcluster/setup.go | 3 +- pkg/controller/rds/optiongroup/setup.go | 7 +- pkg/controller/rds/setup.go | 3 +- pkg/controller/redshift/cluster/controller.go | 9 +- .../redshift/cluster/controller_test.go | 7 +- pkg/controller/redshift/setup.go | 3 +- .../route53/hostedzone/controller.go | 9 +- .../route53/hostedzone/controller_test.go | 9 +- .../route53/resourcerecordset/controller.go | 9 +- .../resourcerecordset/controller_test.go | 9 +- pkg/controller/route53/setup.go | 3 +- .../route53resolver/resolverendpoint/hooks.go | 3 +- .../route53resolver/resolverrule/hooks.go | 9 +- .../resolverruleassociation/hooks.go | 9 +- pkg/controller/route53resolver/setup.go | 3 +- pkg/controller/s3/bucket/CORSConfig.go | 2 +- pkg/controller/s3/bucket/bucket.go | 13 +- pkg/controller/s3/bucket/bucket_test.go | 9 +- pkg/controller/s3/bucket/lifecycleConfig.go | 14 +- .../s3/bucket/lifecycleConfig_test.go | 5 +- pkg/controller/s3/bucket/loggingConfig.go | 3 +- .../s3/bucket/notificationConfig.go | 16 +- .../s3/bucket/notificationConfig_test.go | 3 +- pkg/controller/s3/bucket/policy.go | 5 +- pkg/controller/s3/bucket/publicAccessBlock.go | 3 +- .../s3/bucket/publicAccessBlock_test.go | 3 +- pkg/controller/s3/bucket/replicationConfig.go | 4 +- pkg/controller/s3/bucket/sseConfig.go | 2 +- pkg/controller/s3/bucket/taggingConfig.go | 5 +- pkg/controller/s3/bucket/versioningConfig.go | 2 +- pkg/controller/s3/bucket/websiteConfig.go | 9 +- .../s3/bucketpolicy/bucketpolicy.go | 9 +- .../s3/bucketpolicy/bucketpolicy_test.go | 5 +- pkg/controller/s3/setup.go | 3 +- pkg/controller/s3/testing/testHelper.go | 28 +-- .../s3control/accesspoint/policy.go | 2 +- pkg/controller/s3control/setup.go | 3 +- .../s3control/testing/testHelper.go | 2 +- pkg/controller/secretsmanager/secret/setup.go | 21 +- .../secretsmanager/secret/setup_test.go | 7 +- pkg/controller/secretsmanager/setup.go | 3 +- .../servicediscovery/commonnamespace/hooks.go | 2 +- .../commonnamespace/hooks_test.go | 10 +- .../servicediscovery/httpnamespace/setup.go | 8 +- .../privatednsnamespace/setup.go | 9 +- .../publicdnsnamespace/setup.go | 8 +- .../servicediscovery/service/setup.go | 10 +- pkg/controller/servicediscovery/setup.go | 3 +- .../sesv2/configurationset/setup.go | 15 +- pkg/controller/sesv2/emailidentity/setup.go | 17 +- pkg/controller/sesv2/emailtemplate/setup.go | 4 +- pkg/controller/sesv2/setup.go | 3 +- pkg/controller/sfn/activity/hooks.go | 3 +- pkg/controller/sfn/setup.go | 3 +- pkg/controller/sfn/statemachine/hooks.go | 3 +- pkg/controller/sns/setup.go | 3 +- pkg/controller/sns/subscription/controller.go | 7 +- .../sns/subscription/controller_test.go | 8 +- pkg/controller/sns/topic/controller.go | 7 +- pkg/controller/sns/topic/controller_test.go | 10 +- pkg/controller/sqs/queue/controller.go | 11 +- pkg/controller/sqs/queue/controller_test.go | 7 +- pkg/controller/sqs/setup.go | 3 +- pkg/controller/transfer/server/setup.go | 7 +- pkg/controller/transfer/setup.go | 3 +- pkg/controller/transfer/user/setup.go | 7 +- pkg/utils/metrics/setup.go | 1 - pkg/utils/setup/setup_controller.go | 3 +- 448 files changed, 1369 insertions(+), 1741 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d339855b2a..76b65fe911 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,9 @@ on: env: # Common versions - GO_VERSION: '1.19' - GOLANGCI_VERSION: 'v1.53.3' - DOCKER_BUILDX_VERSION: 'v0.8.2' + GO_VERSION: '1.21.2' + GOLANGCI_VERSION: 'v1.54.2' + DOCKER_BUILDX_VERSION: 'v0.10.0' # Common users. We can't run a step 'if secrets.AWS_USR != ""' but we can run # a step 'if env.AWS_USR' != ""', so we copy these to succinctly test whether @@ -22,6 +22,44 @@ env: AWS_USR: ${{ secrets.AWS_USR }} jobs: + check-diff: + runs-on: ubuntu-22.04 + + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + with: + submodules: true + + - name: Setup Go + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 + with: + go-version: ${{ env.GO_VERSION }} + + - name: Find the Go Build Cache + id: go + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT + + - name: Cache the Go Build Cache + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 + with: + path: ${{ steps.go.outputs.cache }} + key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-build-check-diff- + + - name: Cache Go Dependencies + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 + with: + path: .work/pkg + key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} + restore-keys: ${{ runner.os }}-pkg- + + - name: Vendor Dependencies + run: make vendor vendor.check + + - name: Check Diff + run: make check-diff + detect-noop: runs-on: ubuntu-22.04 outputs: @@ -29,11 +67,12 @@ jobs: steps: - name: Detect No-op Changes id: noop - uses: fkirc/skip-duplicate-actions@v2.0.0 + uses: fkirc/skip-duplicate-actions@12aca0a884f6137d619d6a8a09fcc3406ced5281 # v5.3.0 with: github_token: ${{ secrets.GITHUB_TOKEN }} paths_ignore: '["**.md", "**.png", "**.jpg"]' do_not_skip: '["workflow_dispatch", "schedule", "push"]' + concurrent_skipping: false report-breaking-changes: runs-on: ubuntu-22.04 @@ -65,28 +104,28 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache id: go - run: echo "::set-output name=cache::$(make go.cachedir)" + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-lint-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-lint- - name: Cache Go Dependencies - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -95,42 +134,44 @@ jobs: - name: Vendor Dependencies run: make vendor vendor.check - # We could run 'make lint' but we prefer this action because it leaves - # 'annotations' (i.e. it comments on PRs to point out linter violations). + # We could run 'make lint' to ensure our desired Go version, but we prefer + # this action because it leaves 'annotations' (i.e. it comments on PRs to + # point out linter violations). - name: Lint - uses: golangci/golangci-lint-action@v3 + uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3 with: version: ${{ env.GOLANGCI_VERSION }} + skip-cache: true # We do our own caching. - check-diff: + codeql: runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache id: go - run: echo "::set-output name=cache::$(make go.cachedir)" + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-check-diff-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-check-diff- - name: Cache Go Dependencies - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -139,8 +180,33 @@ jobs: - name: Vendor Dependencies run: make vendor vendor.check - - name: Check Diff - run: make check-diff + - name: Initialize CodeQL + uses: github/codeql-action/init@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2 + with: + languages: go + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@ddccb873888234080b77e9bc2d4764d5ccaaccf9 # v2 + + trivy-scan-fs: + runs-on: ubuntu-22.04 + needs: detect-noop + if: needs.detect-noop.outputs.noop != 'true' + steps: + - name: Checkout + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 + with: + submodules: true + + - name: Run Trivy vulnerability scanner in fs mode + uses: aquasecurity/trivy-action@fbd16365eb88e12433951383f5e99bd901fc618f # 0.12.0 + with: + scan-type: 'fs' + ignore-unfixed: true + skip-dirs: design + scan-ref: '.' + exit-code: '1' + severity: 'CRITICAL,HIGH' unit-tests: runs-on: ubuntu-22.04 @@ -149,7 +215,7 @@ jobs: steps: - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true @@ -157,23 +223,23 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache id: go - run: echo "::set-output name=cache::$(make go.cachedir)" + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-unit-tests-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-unit-tests- - name: Cache Go Dependencies - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -186,7 +252,7 @@ jobs: run: make -j2 test - name: Publish Unit Test Coverage - uses: codecov/codecov-action@v1 + uses: codecov/codecov-action@eaaf4bedf32dbdc6b720b63067d99c4d77d6047d # v3 with: flags: unittests file: _output/tests/linux_amd64/coverage.txt @@ -195,21 +261,20 @@ jobs: runs-on: ubuntu-22.04 needs: detect-noop if: needs.detect-noop.outputs.noop != 'true' - steps: - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3 with: platforms: all - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 with: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true @@ -217,23 +282,23 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache id: go - run: echo "::set-output name=cache::$(make go.cachedir)" + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-e2e-tests-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-e2e-tests- - name: Cache Go Dependencies - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -259,19 +324,29 @@ jobs: if: needs.detect-noop.outputs.noop != 'true' steps: + - name: Cleanup Disk + uses: jlumbroso/free-disk-space@d5af243ce7bacb67384aa6c5b1fc5f169e30903e + with: + android: true + dotnet: true + haskell: true + tool-cache: true + large-packages: false + swap-storage: false + - name: Setup QEMU - uses: docker/setup-qemu-action@v1 + uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3 with: platforms: all - name: Setup Docker Buildx - uses: docker/setup-buildx-action@v1 + uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3 with: version: ${{ env.DOCKER_BUILDX_VERSION }} install: true - name: Checkout - uses: actions/checkout@v2 + uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4 with: submodules: true @@ -279,23 +354,23 @@ jobs: run: git fetch --prune --unshallow - name: Setup Go - uses: actions/setup-go@v2 + uses: actions/setup-go@93397bea11091df50f3d7e59dc26a7711a8bcfbe # v4 with: go-version: ${{ env.GO_VERSION }} - name: Find the Go Build Cache id: go - run: echo "::set-output name=cache::$(make go.cachedir)" + run: echo "cache=$(make go.cachedir)" >> $GITHUB_OUTPUT - name: Cache the Go Build Cache - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: ${{ steps.go.outputs.cache }} key: ${{ runner.os }}-build-publish-artifacts-${{ hashFiles('**/go.sum') }} restore-keys: ${{ runner.os }}-build-publish-artifacts- - name: Cache Go Dependencies - uses: actions/cache@v2 + uses: actions/cache@704facf57e6136b1bc63b828d79edcd491f0ee84 # v3 with: path: .work/pkg key: ${{ runner.os }}-pkg-${{ hashFiles('**/go.sum') }} @@ -310,37 +385,38 @@ jobs: # We're using docker buildx, which doesn't actually load the images it # builds by default. Specifying --load does so. BUILD_ARGS: "--load" - + - name: Publish Artifacts to GitHub - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3 with: name: output path: _output/** - - - name: Login to Docker - uses: docker/login-action@v1 + + - name: Login to DockerHub + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 if: env.CONTRIB_DOCKER_USR != '' with: username: ${{ secrets.CONTRIB_DOCKER_USR }} password: ${{ secrets.CONTRIB_DOCKER_PSW }} - + - name: Login to Upbound - uses: docker/login-action@v1 + uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3 if: env.XPKG_ACCESS_ID != '' with: registry: xpkg.upbound.io username: ${{ secrets.XPKG_ACCESS_ID }} password: ${{ secrets.XPKG_TOKEN }} - - - name: Publish Artifacts to S3 and Docker Hub + + - name: Publish Artifacts to S3, Marketplace, DockerHub run: make -j2 publish BRANCH_NAME=${GITHUB_REF##*/} if: env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != '' env: AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} + AWS_DEFAULT_REGION: us-east-1 GIT_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - - name: Promote Artifacts in S3 and Docker Hub + + - name: Promote Artifacts in S3, DockerHub if: github.ref == 'refs/heads/master' && env.AWS_USR != '' && env.CONTRIB_DOCKER_USR != '' run: make -j2 promote env: @@ -348,4 +424,4 @@ jobs: CHANNEL: master AWS_ACCESS_KEY_ID: ${{ secrets.AWS_USR }} AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_PSW }} - + AWS_DEFAULT_REGION: us-east-1 diff --git a/.golangci.yml b/.golangci.yml index 3546a90acb..008747e51a 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -27,18 +27,16 @@ linters-settings: # report about shadowed variables check-shadowing: false - golint: - # minimal confidence for issues, default is 0.8 - min-confidence: 0.8 - gofmt: # simplify code: gofmt with `-s` option, true by default simplify: true - goimports: - # put imports beginning with prefix after 3rd-party packages; - # it's a comma-separated list of prefixes - local-prefixes: github.com/crossplane-contrib/provider-aws + gci: + custom-order: true + sections: + - standard + - default + - prefix(github.com/crossplane-contrib/provider-aws) gocyclo: # minimal code complexity to report, 30 by default (but we recommend 10-20) @@ -102,21 +100,40 @@ linters-settings: rangeValCopy: sizeThreshold: 32 + nolintlint: + require-explanation: false + require-specific: true + + revive: + rules: + - name: package-comments + disabled: true + + linters: enable: - megacheck - govet - gocyclo - gocritic - - interfacer - goconst - - goimports + - gci - gofmt # We enable this as well as goimports for its simplify mode. - prealloc - - golint + - revive - unconvert - misspell - nakedret + - nolintlint + + disable: + # These linters are all deprecated as of golangci-lint v1.49.0. We disable + # them explicitly to avoid the linter logging deprecation warnings. + - deadcode + - varcheck + - scopelint + - structcheck + - interfacer presets: - bugs @@ -174,6 +191,11 @@ issues: - gosec - gas + # Some k8s dependencies do not have JSON tags on all fields in structs. + - path: k8s.io/ + linters: + - musttag + # Independently from option `exclude` we use default exclude patterns, # it can be disabled by this option. To list all # excluded by default patterns execute `golangci-lint run --help`. diff --git a/CODE_GENERATION.md b/CODE_GENERATION.md index 0ada97a8a1..d83a73ae41 100644 --- a/CODE_GENERATION.md +++ b/CODE_GENERATION.md @@ -111,7 +111,6 @@ package globalaccelerator import ( ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane-contrib/provider-aws/pkg/controller/globalaccelerator/accelerator" diff --git a/Makefile b/Makefile index 3f69a234f2..ea2cecf0aa 100644 --- a/Makefile +++ b/Makefile @@ -39,6 +39,7 @@ GO_STATIC_PACKAGES = $(GO_PROJECT)/cmd/provider GO_LDFLAGS += -X $(GO_PROJECT)/pkg/version.Version=$(VERSION) GO_SUBDIRS += cmd pkg apis GO111MODULE = on +GOLANGCILINT_VERSION = 1.54.2 -include build/makelib/golang.mk # ==================================================================================== diff --git a/apis/apigatewayv2/v1alpha1/referencers.go b/apis/apigatewayv2/v1alpha1/referencers.go index 88f307aac6..bbfd5d7d14 100644 --- a/apis/apigatewayv2/v1alpha1/referencers.go +++ b/apis/apigatewayv2/v1alpha1/referencers.go @@ -21,13 +21,13 @@ import ( "fmt" "strings" - ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/crossplane/crossplane-runtime/pkg/reference" resource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" + + ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" ) // ResolveReferences of this Stage diff --git a/apis/batch/manualv1alpha1/job.go b/apis/batch/manualv1alpha1/job.go index a111e8ef16..7193e57f53 100644 --- a/apis/batch/manualv1alpha1/job.go +++ b/apis/batch/manualv1alpha1/job.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ArrayProperties define an Batch array job. diff --git a/apis/batch/manualv1alpha1/jobdefinition.go b/apis/batch/manualv1alpha1/jobdefinition.go index 9ae14e21a6..2e2e7b1c9e 100644 --- a/apis/batch/manualv1alpha1/jobdefinition.go +++ b/apis/batch/manualv1alpha1/jobdefinition.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FargatePlatformConfiguration defines the platform configuration for jobs that are running on Fargate resources. diff --git a/apis/cache/v1alpha1/cachecluster_types.go b/apis/cache/v1alpha1/cachecluster_types.go index 14843eb7c0..4c5b40439a 100644 --- a/apis/cache/v1alpha1/cachecluster_types.go +++ b/apis/cache/v1alpha1/cachecluster_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // CacheCluster states. diff --git a/apis/cache/v1beta1/referencers.go b/apis/cache/v1beta1/referencers.go index ba3ed6e917..fda133a78c 100644 --- a/apis/cache/v1beta1/referencers.go +++ b/apis/cache/v1beta1/referencers.go @@ -19,11 +19,10 @@ package v1beta1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" sns "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" diff --git a/apis/cache/v1beta1/replication_group_types.go b/apis/cache/v1beta1/replication_group_types.go index f06140b7b0..6259a6ef24 100644 --- a/apis/cache/v1beta1/replication_group_types.go +++ b/apis/cache/v1beta1/replication_group_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ReplicationGroup states. diff --git a/apis/cognitoidentityprovider/manualv1alpha1/groupusermembership_types.go b/apis/cognitoidentityprovider/manualv1alpha1/groupusermembership_types.go index cde716520a..c78a69883c 100644 --- a/apis/cognitoidentityprovider/manualv1alpha1/groupusermembership_types.go +++ b/apis/cognitoidentityprovider/manualv1alpha1/groupusermembership_types.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ExternalAnnotation defines a virtual external name annotation for importing existing resources. diff --git a/apis/database/v1beta1/dbsubnetgroup_types.go b/apis/database/v1beta1/dbsubnetgroup_types.go index 76cfa5f02c..25c3602155 100644 --- a/apis/database/v1beta1/dbsubnetgroup_types.go +++ b/apis/database/v1beta1/dbsubnetgroup_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // DBSubnetGroupStateAvailable states that a DBSubnet Group is healthy and available diff --git a/apis/database/v1beta1/rdsinstance_types.go b/apis/database/v1beta1/rdsinstance_types.go index 8582e4e86e..ed5bfa6601 100644 --- a/apis/database/v1beta1/rdsinstance_types.go +++ b/apis/database/v1beta1/rdsinstance_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // SQL database engines. diff --git a/apis/docdb/v1alpha1/referencers.go b/apis/docdb/v1alpha1/referencers.go index 0d17e160fe..6810eb60c2 100644 --- a/apis/docdb/v1alpha1/referencers.go +++ b/apis/docdb/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" ) diff --git a/apis/dynamodb/v1alpha1/referencers.go b/apis/dynamodb/v1alpha1/referencers.go index 5f10a746db..1a73aea842 100644 --- a/apis/dynamodb/v1alpha1/referencers.go +++ b/apis/dynamodb/v1alpha1/referencers.go @@ -19,10 +19,9 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/crossplane/crossplane-runtime/pkg/reference" ) // ResolveReferences of this Backup diff --git a/apis/ec2/manualv1alpha1/securitygrouprule_types.go b/apis/ec2/manualv1alpha1/securitygrouprule_types.go index b38a150557..403cd66203 100755 --- a/apis/ec2/manualv1alpha1/securitygrouprule_types.go +++ b/apis/ec2/manualv1alpha1/securitygrouprule_types.go @@ -18,7 +18,6 @@ package manualv1alpha1 import ( xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/apis/ec2/manualv1alpha1/vpccidrblock_types.go b/apis/ec2/manualv1alpha1/vpccidrblock_types.go index 274ca6e287..f6f728e792 100644 --- a/apis/ec2/manualv1alpha1/vpccidrblock_types.go +++ b/apis/ec2/manualv1alpha1/vpccidrblock_types.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VPCCIDRBlockParameters define the desired state of an VPC CIDR Block diff --git a/apis/ec2/v1beta1/address_types.go b/apis/ec2/v1beta1/address_types.go index 416a5568d1..fb28d0f389 100644 --- a/apis/ec2/v1beta1/address_types.go +++ b/apis/ec2/v1beta1/address_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // AddressParameters define the desired state of an AWS Elastic IP diff --git a/apis/ec2/v1beta1/internetgateway_types.go b/apis/ec2/v1beta1/internetgateway_types.go index 4972510417..bf31eb9632 100644 --- a/apis/ec2/v1beta1/internetgateway_types.go +++ b/apis/ec2/v1beta1/internetgateway_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // AWS returns 'available` hence ec2.AttachmentStatusAttached doesn't work diff --git a/apis/ec2/v1beta1/natgateway_types.go b/apis/ec2/v1beta1/natgateway_types.go index 4fd03fa7e1..8be4e08634 100644 --- a/apis/ec2/v1beta1/natgateway_types.go +++ b/apis/ec2/v1beta1/natgateway_types.go @@ -1,9 +1,8 @@ package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Defines the states of NatGateway diff --git a/apis/ec2/v1beta1/routetable_types.go b/apis/ec2/v1beta1/routetable_types.go index 7e330090c0..dc87308adf 100644 --- a/apis/ec2/v1beta1/routetable_types.go +++ b/apis/ec2/v1beta1/routetable_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ToDo (haarchri): changed Route to RouteBeta otherwise we got error "CRD for Route.ec2.aws.crossplane.io has no storage version" diff --git a/apis/ec2/v1beta1/securitygroup_types.go b/apis/ec2/v1beta1/securitygroup_types.go index cfc741debb..0ad30c1a4d 100644 --- a/apis/ec2/v1beta1/securitygroup_types.go +++ b/apis/ec2/v1beta1/securitygroup_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // SecurityGroupParameters define the desired state of an AWS VPC Security diff --git a/apis/ec2/v1beta1/subnet_types.go b/apis/ec2/v1beta1/subnet_types.go index 4143fb3aae..acf705b2a5 100644 --- a/apis/ec2/v1beta1/subnet_types.go +++ b/apis/ec2/v1beta1/subnet_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // SubnetParameters define the desired state of an AWS VPC Subnet. diff --git a/apis/ec2/v1beta1/vpc_types.go b/apis/ec2/v1beta1/vpc_types.go index 50b28da0ff..1339abb76b 100644 --- a/apis/ec2/v1beta1/vpc_types.go +++ b/apis/ec2/v1beta1/vpc_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VPCCIDRBlockState represents the state of a CIDR Block diff --git a/apis/ec2/v1beta1/vpccidrblock_types.go b/apis/ec2/v1beta1/vpccidrblock_types.go index 3121d43bb9..05a239ba26 100644 --- a/apis/ec2/v1beta1/vpccidrblock_types.go +++ b/apis/ec2/v1beta1/vpccidrblock_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // VPCCIDRBlockParameters define the desired state of an VPC CIDR Block diff --git a/apis/ecr/v1alpha1/policy_types.go b/apis/ecr/v1alpha1/policy_types.go index c4a77386d5..8d6aca49e9 100644 --- a/apis/ecr/v1alpha1/policy_types.go +++ b/apis/ecr/v1alpha1/policy_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RepositoryPolicyParameters define the desired state of an AWS Elastic Container Repository diff --git a/apis/ecr/v1alpha1/repository_types.go b/apis/ecr/v1alpha1/repository_types.go index ac9a81239c..f09bf39927 100644 --- a/apis/ecr/v1alpha1/repository_types.go +++ b/apis/ecr/v1alpha1/repository_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RepositoryParameters define the desired state of an AWS Elastic Container Repository diff --git a/apis/ecr/v1beta1/policy_types.go b/apis/ecr/v1beta1/policy_types.go index 3aab226138..809863b09d 100644 --- a/apis/ecr/v1beta1/policy_types.go +++ b/apis/ecr/v1beta1/policy_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RepositoryPolicyParameters define the desired state of an AWS Elastic Container Repository diff --git a/apis/ecr/v1beta1/referencers.go b/apis/ecr/v1beta1/referencers.go index cfeaa40f2d..8a08854bdc 100644 --- a/apis/ecr/v1beta1/referencers.go +++ b/apis/ecr/v1beta1/referencers.go @@ -20,11 +20,10 @@ import ( "context" "fmt" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) diff --git a/apis/ecr/v1beta1/repository_types.go b/apis/ecr/v1beta1/repository_types.go index 24b7e8d85f..3f80783065 100644 --- a/apis/ecr/v1beta1/repository_types.go +++ b/apis/ecr/v1beta1/repository_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RepositoryParameters define the desired state of an AWS Elastic Container Repository diff --git a/apis/efs/v1alpha1/referencers.go b/apis/efs/v1alpha1/referencers.go index 055cb510cd..9b9a4cac2a 100644 --- a/apis/efs/v1alpha1/referencers.go +++ b/apis/efs/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - network "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" ) diff --git a/apis/eks/manualv1alpha1/fargate_profile_types.go b/apis/eks/manualv1alpha1/fargate_profile_types.go index 8ef2e202c0..5f34a85713 100644 --- a/apis/eks/manualv1alpha1/fargate_profile_types.go +++ b/apis/eks/manualv1alpha1/fargate_profile_types.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FargateProfileStatusType is a type of FargateProfile status. diff --git a/apis/eks/manualv1alpha1/nodegroup_types.go b/apis/eks/manualv1alpha1/nodegroup_types.go index f8ffa05539..7b6b4eef3c 100644 --- a/apis/eks/manualv1alpha1/nodegroup_types.go +++ b/apis/eks/manualv1alpha1/nodegroup_types.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // NodeGroupStatusType is a type of NodeGroup status. diff --git a/apis/eks/v1beta1/fargate_profile_types.go b/apis/eks/v1beta1/fargate_profile_types.go index fbc7189210..de809a8dc5 100644 --- a/apis/eks/v1beta1/fargate_profile_types.go +++ b/apis/eks/v1beta1/fargate_profile_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // FargateProfileStatusType is a type of FargateProfile status. diff --git a/apis/eks/v1beta1/types.go b/apis/eks/v1beta1/types.go index 91824267da..e706868032 100644 --- a/apis/eks/v1beta1/types.go +++ b/apis/eks/v1beta1/types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ClusterStatusType is the status of an EKS cluster. diff --git a/apis/elasticloadbalancing/v1alpha1/elb_types.go b/apis/elasticloadbalancing/v1alpha1/elb_types.go index fc50c7925a..42ba2db310 100644 --- a/apis/elasticloadbalancing/v1alpha1/elb_types.go +++ b/apis/elasticloadbalancing/v1alpha1/elb_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Tag defines a key value pair that can be attached to an ELB diff --git a/apis/elasticloadbalancing/v1alpha1/referencers.go b/apis/elasticloadbalancing/v1alpha1/referencers.go index 321bfdea43..6188e7f979 100644 --- a/apis/elasticloadbalancing/v1alpha1/referencers.go +++ b/apis/elasticloadbalancing/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" ) diff --git a/apis/iam/v1beta1/accesskey_types.go b/apis/iam/v1beta1/accesskey_types.go index d7701b0590..9181e3410d 100644 --- a/apis/iam/v1beta1/accesskey_types.go +++ b/apis/iam/v1beta1/accesskey_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // AccessKeyParameters define the desired state of an AWS IAM Access Key. diff --git a/apis/iam/v1beta1/group_types.go b/apis/iam/v1beta1/group_types.go index a098ac9097..d83d00eafa 100644 --- a/apis/iam/v1beta1/group_types.go +++ b/apis/iam/v1beta1/group_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // GroupParameters define the desired state of an AWS IAM Group. diff --git a/apis/iam/v1beta1/grouppolicyattachment_types.go b/apis/iam/v1beta1/grouppolicyattachment_types.go index 88368b1487..b47a5870ca 100644 --- a/apis/iam/v1beta1/grouppolicyattachment_types.go +++ b/apis/iam/v1beta1/grouppolicyattachment_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // GroupPolicyAttachmentParameters define the desired state of an AWS GroupPolicyAttachment. diff --git a/apis/iam/v1beta1/groupusermembership_types.go b/apis/iam/v1beta1/groupusermembership_types.go index 24628b0ecc..e73e864ea4 100644 --- a/apis/iam/v1beta1/groupusermembership_types.go +++ b/apis/iam/v1beta1/groupusermembership_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // GroupUserMembershipParameters define the desired state of an AWS GroupUserMembership. diff --git a/apis/iam/v1beta1/policy_types.go b/apis/iam/v1beta1/policy_types.go index b9a5633f68..1802b5104a 100644 --- a/apis/iam/v1beta1/policy_types.go +++ b/apis/iam/v1beta1/policy_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // PolicyParameters define the desired state of an AWS IAM Policy. diff --git a/apis/iam/v1beta1/role_types.go b/apis/iam/v1beta1/role_types.go index d84e499c3f..e9097dcf0d 100644 --- a/apis/iam/v1beta1/role_types.go +++ b/apis/iam/v1beta1/role_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Tag represents user-provided metadata that can be associated diff --git a/apis/iam/v1beta1/rolepolicyattachment_types.go b/apis/iam/v1beta1/rolepolicyattachment_types.go index d3f934a4eb..d0e4df68e9 100644 --- a/apis/iam/v1beta1/rolepolicyattachment_types.go +++ b/apis/iam/v1beta1/rolepolicyattachment_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // RolePolicyAttachmentParameters define the desired state of an AWS IAM diff --git a/apis/iam/v1beta1/user_types.go b/apis/iam/v1beta1/user_types.go index a3e318525c..4d7751ae40 100644 --- a/apis/iam/v1beta1/user_types.go +++ b/apis/iam/v1beta1/user_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // UserParameters define the desired state of an AWS IAM User. diff --git a/apis/iam/v1beta1/userpolicyattachment_types.go b/apis/iam/v1beta1/userpolicyattachment_types.go index 5ccbce73ea..2278be7090 100644 --- a/apis/iam/v1beta1/userpolicyattachment_types.go +++ b/apis/iam/v1beta1/userpolicyattachment_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // UserPolicyAttachmentParameters define the desired state of an AWS UserPolicyAttachment. diff --git a/apis/lambda/manualv1alpha1/permission.go b/apis/lambda/manualv1alpha1/permission.go index 3cc55f7311..bf3d403e0c 100644 --- a/apis/lambda/manualv1alpha1/permission.go +++ b/apis/lambda/manualv1alpha1/permission.go @@ -20,10 +20,9 @@ import ( "fmt" "hash/fnv" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/yaml" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) // PermissionParameters define the desired state of a Lambda Permission @@ -121,7 +120,7 @@ func (ps *PermissionSpec) Hash() string { // known, strongly typed struct. return "unknown" } - h.Write(y) //nolint:errcheck // Writing to a hash never errors. + h.Write(y) return fmt.Sprintf("%x", h.Sum64()) } diff --git a/apis/lambda/v1alpha1/referencers.go b/apis/lambda/v1alpha1/referencers.go index 462762df2d..3684e399e8 100644 --- a/apis/lambda/v1alpha1/referencers.go +++ b/apis/lambda/v1alpha1/referencers.go @@ -19,15 +19,14 @@ package v1alpha1 import ( "context" - s3v1beta1 "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" + "github.com/crossplane/crossplane-runtime/pkg/reference" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" - - "github.com/crossplane/crossplane-runtime/pkg/reference" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" + s3v1beta1 "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" ) // ResolveReferences of this Function diff --git a/apis/lambda/v1beta1/referencers.go b/apis/lambda/v1beta1/referencers.go index 0eb7a45617..02d6df7836 100644 --- a/apis/lambda/v1beta1/referencers.go +++ b/apis/lambda/v1beta1/referencers.go @@ -19,16 +19,15 @@ package v1beta1 import ( "context" - s3v1beta1 "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" - - ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" - iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" - "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" + + ec2 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" + iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" + kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" + s3v1beta1 "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" ) // FunctionARN returns the status.atProvider.ARN of a Function. diff --git a/apis/rds/v1alpha1/referencers.go b/apis/rds/v1alpha1/referencers.go index 0dcd39bb95..80893f15bd 100644 --- a/apis/rds/v1alpha1/referencers.go +++ b/apis/rds/v1alpha1/referencers.go @@ -20,16 +20,15 @@ import ( "context" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reference" + "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" database "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" network "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" kmsv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" - - "github.com/crossplane/crossplane-runtime/pkg/reference" - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" ) // ResolveReferences of this DBCluster diff --git a/apis/redshift/v1alpha1/redshift_types.go b/apis/redshift/v1alpha1/redshift_types.go index 2b92d03310..0b7d56aa54 100644 --- a/apis/redshift/v1alpha1/redshift_types.go +++ b/apis/redshift/v1alpha1/redshift_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Redshift cluster states. diff --git a/apis/redshift/v1alpha1/referencers.go b/apis/redshift/v1alpha1/referencers.go index f304b616ad..02184e6800 100644 --- a/apis/redshift/v1alpha1/referencers.go +++ b/apis/redshift/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - network "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) diff --git a/apis/route53/v1alpha1/hostedzone_types.go b/apis/route53/v1alpha1/hostedzone_types.go index 52c5e6d2a9..377cf667d6 100644 --- a/apis/route53/v1alpha1/hostedzone_types.go +++ b/apis/route53/v1alpha1/hostedzone_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // +kubebuilder:object:root=true diff --git a/apis/route53/v1alpha1/referencers.go b/apis/route53/v1alpha1/referencers.go index dc1213c0e0..e0f5b9b230 100644 --- a/apis/route53/v1alpha1/referencers.go +++ b/apis/route53/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" ) diff --git a/apis/route53/v1alpha1/resourcerecordset_types.go b/apis/route53/v1alpha1/resourcerecordset_types.go index f8012a54f7..e391324bc7 100644 --- a/apis/route53/v1alpha1/resourcerecordset_types.go +++ b/apis/route53/v1alpha1/resourcerecordset_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // ResourceRecordSetParameters define the desired state of an AWS Route53 Resource Record. diff --git a/apis/route53resolver/manualv1alpha1/resolverruleassociation_types.go b/apis/route53resolver/manualv1alpha1/resolverruleassociation_types.go index ce417abde8..09640caa2f 100644 --- a/apis/route53resolver/manualv1alpha1/resolverruleassociation_types.go +++ b/apis/route53resolver/manualv1alpha1/resolverruleassociation_types.go @@ -17,9 +17,8 @@ limitations under the License. package manualv1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Types of ResolverRuleAssociation status. diff --git a/apis/route53resolver/v1alpha1/referencers.go b/apis/route53resolver/v1alpha1/referencers.go index 53b9e716eb..690fbddad3 100644 --- a/apis/route53resolver/v1alpha1/referencers.go +++ b/apis/route53resolver/v1alpha1/referencers.go @@ -21,7 +21,6 @@ import ( "fmt" "github.com/crossplane/crossplane-runtime/pkg/reference" - "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" diff --git a/apis/s3/common/bucketpolicy_types.go b/apis/s3/common/bucketpolicy_types.go index a115b1c1ff..50e3cd64db 100644 --- a/apis/s3/common/bucketpolicy_types.go +++ b/apis/s3/common/bucketpolicy_types.go @@ -17,9 +17,8 @@ limitations under the License. package common import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // BucketPolicyBody represents an S3 bucket policy in the manifest diff --git a/apis/s3/v1alpha3/bucketpolicy_types.go b/apis/s3/v1alpha3/bucketpolicy_types.go index e3b9f122f6..d046b6d7fa 100644 --- a/apis/s3/v1alpha3/bucketpolicy_types.go +++ b/apis/s3/v1alpha3/bucketpolicy_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha3 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/s3/common" ) diff --git a/apis/secretsmanager/v1alpha1/referencers.go b/apis/secretsmanager/v1alpha1/referencers.go index b0829c3f01..e60ce93d47 100644 --- a/apis/secretsmanager/v1alpha1/referencers.go +++ b/apis/secretsmanager/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" ) diff --git a/apis/secretsmanager/v1beta1/referencers.go b/apis/secretsmanager/v1beta1/referencers.go index d2ed33736a..0e0d28d109 100644 --- a/apis/secretsmanager/v1beta1/referencers.go +++ b/apis/secretsmanager/v1beta1/referencers.go @@ -19,11 +19,10 @@ package v1beta1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - kms "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" ) diff --git a/apis/servicediscovery/v1alpha1/referencers.go b/apis/servicediscovery/v1alpha1/referencers.go index 6032c7f82d..e4ccf8de0b 100644 --- a/apis/servicediscovery/v1alpha1/referencers.go +++ b/apis/servicediscovery/v1alpha1/referencers.go @@ -3,11 +3,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - ec2v1beta1 "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" ) diff --git a/apis/sfn/v1alpha1/referencers.go b/apis/sfn/v1alpha1/referencers.go index d348f110c9..0e20acba44 100644 --- a/apis/sfn/v1alpha1/referencers.go +++ b/apis/sfn/v1alpha1/referencers.go @@ -19,11 +19,10 @@ package v1alpha1 import ( "context" + "github.com/crossplane/crossplane-runtime/pkg/reference" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" - iamv1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) diff --git a/apis/sns/v1beta1/referencers.go b/apis/sns/v1beta1/referencers.go index 65247e678e..26aa9e261f 100644 --- a/apis/sns/v1beta1/referencers.go +++ b/apis/sns/v1beta1/referencers.go @@ -19,11 +19,10 @@ package v1beta1 import ( "context" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/crossplane/crossplane-runtime/pkg/reference" resource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" ) // SNSTopicARN returns a function that returns the ARN of the given SNS Topic. diff --git a/apis/sns/v1beta1/subscription_types.go b/apis/sns/v1beta1/subscription_types.go index c065c49222..8c51939cff 100644 --- a/apis/sns/v1beta1/subscription_types.go +++ b/apis/sns/v1beta1/subscription_types.go @@ -18,7 +18,6 @@ package v1beta1 import ( xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/apis/sns/v1beta1/topic_types.go b/apis/sns/v1beta1/topic_types.go index ac53a3ea03..a43a58846d 100644 --- a/apis/sns/v1beta1/topic_types.go +++ b/apis/sns/v1beta1/topic_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Tag represent a user-provided metadata that can be associated with a diff --git a/apis/sqs/v1beta1/queue_types.go b/apis/sqs/v1beta1/queue_types.go index 2e7d284008..9da3127d1a 100644 --- a/apis/sqs/v1beta1/queue_types.go +++ b/apis/sqs/v1beta1/queue_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // Enum values for Queue attribute names diff --git a/apis/v1alpha1/storeconfig_types.go b/apis/v1alpha1/storeconfig_types.go index a94ae90611..3030bf059e 100644 --- a/apis/v1alpha1/storeconfig_types.go +++ b/apis/v1alpha1/storeconfig_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1alpha1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // A StoreConfigSpec defines the desired state of a ProviderConfig. diff --git a/apis/v1beta1/providerconfig_types.go b/apis/v1beta1/providerconfig_types.go index d113df8356..be0ffa3a1f 100644 --- a/apis/v1beta1/providerconfig_types.go +++ b/apis/v1beta1/providerconfig_types.go @@ -17,9 +17,8 @@ limitations under the License. package v1beta1 import ( - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) // A ProviderConfigSpec defines the desired state of a ProviderConfig. diff --git a/build b/build index bd5297bd16..2672eeb767 160000 --- a/build +++ b/build @@ -1 +1 @@ -Subproject commit bd5297bd16c113cbc5ed1905b1d96aa1cb3078ec +Subproject commit 2672eeb767636ec837aa7c63cd7e26e6089fa810 diff --git a/cmd/provider/main.go b/cmd/provider/main.go index f63ee2b809..216c2d3c0d 100644 --- a/cmd/provider/main.go +++ b/cmd/provider/main.go @@ -22,13 +22,6 @@ import ( "path/filepath" "time" - "gopkg.in/alecthomas/kingpin.v2" - kerrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/client-go/tools/leaderelection/resourcelock" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/log/zap" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" xpcontroller "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/feature" @@ -36,6 +29,12 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/ratelimiter" "github.com/crossplane/crossplane-runtime/pkg/resource" "go.uber.org/zap/zapcore" + "gopkg.in/alecthomas/kingpin.v2" + kerrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/client-go/tools/leaderelection/resourcelock" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/log/zap" "github.com/crossplane-contrib/provider-aws/apis" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/go.mod b/go.mod index 3920e8c8f9..2cc0dfd730 100644 --- a/go.mod +++ b/go.mod @@ -1,6 +1,6 @@ module github.com/crossplane-contrib/provider-aws -go 1.19 +go 1.21 require ( github.com/aws-controllers-k8s/code-generator v0.26.1 diff --git a/go.sum b/go.sum index 10145331b5..7fbd8da796 100644 --- a/go.sum +++ b/go.sum @@ -92,6 +92,7 @@ github.com/aws-controllers-k8s/code-generator v0.26.1/go.mod h1:JP9b2NiBqKN/Xxj3 github.com/aws-controllers-k8s/pkg v0.0.4 h1:fQX18NZZG6eVKdG3WWp/oE7QJgFe7Dz/Ublu+ua4PW8= github.com/aws-controllers-k8s/pkg v0.0.4/go.mod h1:LC/9DlYrXu8FWNwLquZLq1WhcyRo7qXb7upRLAEosQk= github.com/aws-controllers-k8s/runtime v0.26.0 h1:XKqygFzHSBtM74Ov9IroZbyCVeYei9Eskp4aKbJ2SFw= +github.com/aws-controllers-k8s/runtime v0.26.0/go.mod h1:jizDzKikL09cueIuA9ZxoZ+4pfn5U7oKW5s/ZAqOA6E= github.com/aws/aws-sdk-go v1.44.334 h1:h2bdbGb//fez6Sv6PaYv868s9liDeoYM6hYsAqTB4MU= github.com/aws/aws-sdk-go v1.44.334/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI= github.com/aws/aws-sdk-go-v2 v1.10.0/go.mod h1:U/EyyVvKtzmFeQQcca7eBotKdlpcP2zzU6bXBYcf7CE= @@ -355,7 +356,9 @@ github.com/go-playground/locales v0.13.0/go.mod h1:taPMhCMXrRLJO55olJkUXHZBHCxTM github.com/go-playground/universal-translator v0.17.0/go.mod h1:UkSxE5sNxxRwHyU+Scu5vgOQjsIJAF8j9muTVoKLVtA= github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY= github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572 h1:tfuBGBXKqDEevZMzYi5KSi8KkcZtzBcTgAUUtapy0OI= +github.com/go-task/slim-sprig v0.0.0-20230315185526-52ccab3ef572/go.mod h1:9Pwr4B2jHnOSGXyyzV8ROjYa2ojvAY6HCGYYfMoC3Ls= github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw= +github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA= github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80= github.com/gobuffalo/flect v1.0.2 h1:eqjPGSo2WmjgY2XlpGwo2NXgL3RucAKo4k4qQMNA5sA= github.com/gobuffalo/flect v1.0.2/go.mod h1:A5msMlrHtLqh9umBSnvabjsMrCcCpAyzglnDvkbYKHs= @@ -438,6 +441,7 @@ github.com/google/pprof v0.0.0-20201023163331-3e6fc7fc9c4c/go.mod h1:kpwsk12EmLe github.com/google/pprof v0.0.0-20201203190320-1bf35d6f28c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20201218002935-b9804c9f04c2/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE= github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8 h1:n6vlPhxsA+BW/XsS5+uqi7GyzaLa5MH7qlSLBZtRdiA= +github.com/google/pprof v0.0.0-20230705174524-200ffdc848b8/go.mod h1:Jh3hGz2jkYak8qXPD19ryItVnUgpgeqzdkY/D0EaeuA= github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI= github.com/google/uuid v1.0.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -473,6 +477,7 @@ github.com/hashicorp/go-cleanhttp v0.5.2 h1:035FKYIWjmULyFRBKPs8TBQoi0x6d9G4xc9n github.com/hashicorp/go-cleanhttp v0.5.2/go.mod h1:kO/YDlP8L1346E6Sodw+PrpBSV4/SoxCXGY6BqNFT48= github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ= github.com/hashicorp/go-hclog v0.16.2 h1:K4ev2ib4LdQETX5cSZBG0DVLk1jwGqSPXBjdah3veNs= +github.com/hashicorp/go-hclog v0.16.2/go.mod h1:whpDNt7SSdeAju8AWKIWsul05p54N/39EeqMAyrmvFQ= github.com/hashicorp/go-immutable-radix v1.0.0/go.mod h1:0y9vanUI8NX6FsYoO3zeMjhV/C5i9g4Q3DwcSNZ4P60= github.com/hashicorp/go-msgpack v0.5.3/go.mod h1:ahLV/dePpqEmjfWmKiqvPkv/twdG7iPBM1vqhUKIvfM= github.com/hashicorp/go-multierror v1.0.0/go.mod h1:dHtQlpGsu+cZNNAkkCN/P3hoUDHhCYQXV3UM06sGGrk= @@ -519,6 +524,7 @@ github.com/inconshreveable/mousetrap v1.0.0/go.mod h1:PxqpIevigyE2G7u3NXJIT2ANyt github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= github.com/jaypipes/envutil v1.0.0 h1:u6Vwy9HwruFihoZrL0bxDLCa/YNadGVwKyPElNmZWow= +github.com/jaypipes/envutil v1.0.0/go.mod h1:vgIRDly+xgBq0eeZRcflOHMMobMwgC6MkMbxo/Nw65M= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99 h1:BQSFePA1RWJOlocH6Fxy8MmwDt+yVQYULKfN0RoTN8A= github.com/jbenet/go-context v0.0.0-20150711004518-d14ea06fba99/go.mod h1:1lJo3i6rXxKeerYnT8Nvf0QmHCRC1n8sfWVwXF2Frvo= github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI= @@ -553,6 +559,7 @@ github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORN github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.2.1/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE= +github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/pty v1.1.5/go.mod h1:9r2w37qlBe7rQ6e1fg1S/9xpWHSnaqNdHD3WcMdbPDA= github.com/kr/pty v1.1.8/go.mod h1:O1sed60cT9XZ5uDucP5qwvh+TE3NnUj51EiZO/lmSfw= @@ -627,6 +634,7 @@ github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRW github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f/go.mod h1:ZdcZmHo+o7JKHSa8/e818NopupXU1YMK5fe1lsApnBw= github.com/nxadm/tail v1.4.4/go.mod h1:kenIhsEOeOJmVchQTgglprH7qJGnHDVpk1VPCcaMI8A= github.com/nxadm/tail v1.4.8 h1:nPr65rt6Y5JFSKQO7qToXr7pePgD6Gwiw05lkbyAQTE= +github.com/nxadm/tail v1.4.8/go.mod h1:+ncqLTQzXmGhMZNUePPaPqPvBxHAIsmXswZKocGu+AU= github.com/oklog/ulid v1.3.1/go.mod h1:CirwcVhetQ6Lv90oh/F+FBtV6XMibvdAFo93nm5qn4U= github.com/olekukonko/tablewriter v0.0.0-20170122224234-a0225b3f23b5/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/onsi/ginkgo v0.0.0-20170829012221-11459a886d9c/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= @@ -635,7 +643,9 @@ github.com/onsi/ginkgo v1.11.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+ github.com/onsi/ginkgo v1.12.1/go.mod h1:zj2OWP4+oCPe1qIXoGWkgMRwljMUYCdkwsT2108oapk= github.com/onsi/ginkgo v1.14.1/go.mod h1:iSB4RoI2tjJc9BBv4NKIKWKya62Rps+oPG/Lv9klQyY= github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE= +github.com/onsi/ginkgo v1.16.5/go.mod h1:+E8gABHa3K6zRBolWtd+ROzc/U5bkGt0FwiG042wbpU= github.com/onsi/ginkgo/v2 v2.9.5 h1:+6Hr4uxzP4XIUyAkg61dWBw8lb/gc4/X5luuxN/EC+Q= +github.com/onsi/ginkgo/v2 v2.9.5/go.mod h1:tvAoo1QUJwNEU2ITftXTpR7R1RbCzoZUOs3RonqW57k= github.com/onsi/gomega v0.0.0-20170829124025-dcabb60a477c/go.mod h1:C1qb7wdrVGGVU+Z6iS04AVkA3Q65CEZX59MT0QO5uiA= github.com/onsi/gomega v1.7.0/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY= github.com/onsi/gomega v1.7.1/go.mod h1:XdKZgCCFLUoM/7CFJVPcG8C1xQ1AJ0vpAezJrB7JYyY= @@ -690,6 +700,7 @@ github.com/rogpeppe/fastuuid v0.0.0-20150106093220-6724a57986af/go.mod h1:XWv6So github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ= github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4= github.com/rogpeppe/go-internal v1.10.0 h1:TMyTOH3F/DB16zRVcYyreMH6GnZZrwQVAoYjRBZyWFQ= +github.com/rogpeppe/go-internal v1.10.0/go.mod h1:UQnix2H7Ngw/k4C5ijL5+65zddjncjaFoBhdsK/akog= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= github.com/russross/blackfriday/v2 v2.0.1/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= @@ -795,6 +806,7 @@ go.uber.org/atomic v1.11.0/go.mod h1:LUxbIzbOniOlMKjJjyPfpl4v+PKK2cNJn91OQbhoJI0 go.uber.org/goleak v1.1.10/go.mod h1:8a7PlsEVH3e/a/GLqe5IIrQx6GzcnRmZEufDUTk4A7A= go.uber.org/goleak v1.1.11/go.mod h1:cwTWslyiVhfpKIDGSZEM2HlOvcqm+tG4zioyIeLoqMQ= go.uber.org/goleak v1.2.1 h1:NBol2c7O1ZokfZ0LEU9K6Whx/KnwvepVetCUhtKja4A= +go.uber.org/goleak v1.2.1/go.mod h1:qlT2yGI9QafXHhZZLxlSuNsMw3FFLxBr+tBRlmO1xH4= go.uber.org/multierr v1.1.0/go.mod h1:wR5kodmAFQ0UK8QlbwjlSNy0Z68gJhDJUG5sjR94q/0= go.uber.org/multierr v1.5.0/go.mod h1:FeouvMocqHpRaaGuG9EjoKcStLC43Zu/fmqdUMPcKYU= go.uber.org/multierr v1.6.0/go.mod h1:cdWPpRnG4AhwMwsgIHip0KRBQjJy5kYEpYjJxpXp9iU= @@ -944,6 +956,7 @@ golang.org/x/sync v0.0.0-20201207232520-09787c993a3a/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.3.0 h1:ftCYgMx6zT/asHUrPw8BLLscYtGznsLAnjq5RH9P66E= +golang.org/x/sync v0.3.0/go.mod h1:FU7BRWz2tNW+3quACPkgCx/L+uEAv1htQ0V83Z9Rj+Y= golang.org/x/sys v0.0.0-20170830134202-bb24a47a89ea/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= diff --git a/pkg/clients/acm/certificate.go b/pkg/clients/acm/certificate.go index 3744a96a04..9e7380c96b 100644 --- a/pkg/clients/acm/certificate.go +++ b/pkg/clients/acm/certificate.go @@ -4,13 +4,12 @@ import ( "context" "errors" - "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/acm" "github.com/aws/aws-sdk-go-v2/service/acm/types" acmtypes "github.com/aws/aws-sdk-go-v2/service/acm/types" + "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) @@ -100,7 +99,7 @@ func GenerateCertificateStatus(certificate types.CertificateDetail) v1beta1.Cert // LateInitializeCertificate fills the empty fields in *v1beta1.CertificateParameters with // the values seen in iam.Certificate. -func LateInitializeCertificate(in *v1beta1.CertificateParameters, certificate *types.CertificateDetail) { // nolint:gocyclo +func LateInitializeCertificate(in *v1beta1.CertificateParameters, certificate *types.CertificateDetail) { in.CertificateAuthorityARN = awsclients.LateInitializeStringPtr(in.CertificateAuthorityARN, certificate.CertificateAuthorityArn) if in.Options == nil && certificate.Options != nil { in.Options = &v1beta1.CertificateOptions{ @@ -127,7 +126,7 @@ func LateInitializeCertificate(in *v1beta1.CertificateParameters, certificate *t } // IsCertificateUpToDate checks whether there is a change in any of the modifiable fields. -func IsCertificateUpToDate(p v1beta1.CertificateParameters, cd types.CertificateDetail, tags []types.Tag) bool { // nolint:gocyclo +func IsCertificateUpToDate(p v1beta1.CertificateParameters, cd types.CertificateDetail, tags []types.Tag) bool { if (p.Options != nil && cd.Options == nil) || (p.Options == nil && cd.Options != nil) { return false } diff --git a/pkg/clients/acm/certificate_test.go b/pkg/clients/acm/certificate_test.go index a6895f4cca..c8168d9f2d 100644 --- a/pkg/clients/acm/certificate_test.go +++ b/pkg/clients/acm/certificate_test.go @@ -3,16 +3,13 @@ package acm import ( "testing" - "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" - - "github.com/aws/smithy-go/document" - - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/acm" acmtypes "github.com/aws/aws-sdk-go-v2/service/acm/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/clients/acmpca/certificateauthority.go b/pkg/clients/acmpca/certificateauthority.go index dfbff27f41..dc00254abc 100644 --- a/pkg/clients/acmpca/certificateauthority.go +++ b/pkg/clients/acmpca/certificateauthority.go @@ -64,7 +64,7 @@ func GenerateCreateCertificateAuthorityInput(p *v1beta1.CertificateAuthorityPara } // GenerateCertificateAuthorityConfiguration from CertificateAuthorityConfiguration -func GenerateCertificateAuthorityConfiguration(p v1beta1.CertificateAuthorityConfiguration) *types.CertificateAuthorityConfiguration { // nolint:gocyclo +func GenerateCertificateAuthorityConfiguration(p v1beta1.CertificateAuthorityConfiguration) *types.CertificateAuthorityConfiguration { m := &types.CertificateAuthorityConfiguration{ Subject: &types.ASN1Subject{ @@ -110,7 +110,7 @@ func GenerateRevocationConfiguration(p *v1beta1.RevocationConfiguration) *types. // LateInitializeCertificateAuthority fills the empty fields in *v1beta1.CertificateAuthorityParameters with // the values seen in acmpca.CertificateAuthority. -func LateInitializeCertificateAuthority(in *v1beta1.CertificateAuthorityParameters, certificateAuthority *types.CertificateAuthority) { // nolint:gocyclo +func LateInitializeCertificateAuthority(in *v1beta1.CertificateAuthorityParameters, certificateAuthority *types.CertificateAuthority) { //nolint:gocyclo if certificateAuthority == nil { return } @@ -142,7 +142,7 @@ func LateInitializeCertificateAuthority(in *v1beta1.CertificateAuthorityParamete } // IsCertificateAuthorityUpToDate checks whether there is a change in any of the modifiable fields. -func IsCertificateAuthorityUpToDate(p *v1beta1.CertificateAuthority, cd types.CertificateAuthority, tags []types.Tag) bool { // nolint:gocyclo +func IsCertificateAuthorityUpToDate(p *v1beta1.CertificateAuthority, cd types.CertificateAuthority, tags []types.Tag) bool { //nolint:gocyclo if cd.RevocationConfiguration.CrlConfiguration.Enabled { if !strings.EqualFold(aws.ToString(p.Spec.ForProvider.RevocationConfiguration.CustomCname), aws.ToString(cd.RevocationConfiguration.CrlConfiguration.CustomCname)) { diff --git a/pkg/clients/cloudsearch/fake/cloudsearch.go b/pkg/clients/cloudsearch/fake/cloudsearch.go index 2632159b1a..f222ba6976 100644 --- a/pkg/clients/cloudsearch/fake/cloudsearch.go +++ b/pkg/clients/cloudsearch/fake/cloudsearch.go @@ -17,11 +17,10 @@ limitations under the License. package fake import ( - svcsdkapi "github.com/aws/aws-sdk-go/service/cloudsearch/cloudsearchiface" - "github.com/aws/aws-sdk-go/aws" "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/cloudsearch" + svcsdkapi "github.com/aws/aws-sdk-go/service/cloudsearch/cloudsearchiface" ) // this ensures that the mock implements the client interface diff --git a/pkg/clients/cognitoidentityprovider/cognitoidentityprovider.go b/pkg/clients/cognitoidentityprovider/cognitoidentityprovider.go index 407a94e619..318cb98250 100644 --- a/pkg/clients/cognitoidentityprovider/cognitoidentityprovider.go +++ b/pkg/clients/cognitoidentityprovider/cognitoidentityprovider.go @@ -19,12 +19,11 @@ package cognitoidentityprovider import ( "context" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) const ( diff --git a/pkg/clients/cognitoidentityprovider/groupusermembership.go b/pkg/clients/cognitoidentityprovider/groupusermembership.go index 6e05ed3b94..739aa633d7 100644 --- a/pkg/clients/cognitoidentityprovider/groupusermembership.go +++ b/pkg/clients/cognitoidentityprovider/groupusermembership.go @@ -2,14 +2,11 @@ package cognitoidentityprovider import ( "context" - - "github.com/aws/aws-sdk-go-v2/aws" - - "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" - "errors" + "github.com/aws/aws-sdk-go-v2/aws" cognitoidentityprovidertypes "github.com/aws/aws-sdk-go-v2/service/acm/types" + "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" ) // GroupUserMembershipClient is the external client used for GroupUserMembership Custom Resource diff --git a/pkg/clients/config.go b/pkg/clients/config.go index 542aae5258..a5a8b71cf2 100644 --- a/pkg/clients/config.go +++ b/pkg/clients/config.go @@ -27,23 +27,21 @@ import ( "github.com/aws/aws-sdk-go-v2/config" "github.com/aws/aws-sdk-go-v2/credentials" "github.com/aws/aws-sdk-go-v2/credentials/stscreds" - stscredstypesv2 "github.com/aws/aws-sdk-go-v2/service/sts/types" - "github.com/aws/aws-sdk-go-v2/service/sts" + stscredstypesv2 "github.com/aws/aws-sdk-go-v2/service/sts/types" awsv1 "github.com/aws/aws-sdk-go/aws" credentialsv1 "github.com/aws/aws-sdk-go/aws/credentials" endpointsv1 "github.com/aws/aws-sdk-go/aws/endpoints" requestv1 "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/smithy-go/middleware" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/go-ini/ini" "github.com/pkg/errors" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane-contrib/provider-aws/apis/v1beta1" "github.com/crossplane-contrib/provider-aws/pkg/utils/metrics" "github.com/crossplane-contrib/provider-aws/pkg/version" @@ -102,7 +100,7 @@ func GetConfig(ctx context.Context, c client.Client, mg resource.Managed, region } // UseProviderConfig to produce a config that can be used to authenticate to AWS. -func UseProviderConfig(ctx context.Context, c client.Client, mg resource.Managed, region string) (*aws.Config, error) { // nolint:gocyclo +func UseProviderConfig(ctx context.Context, c client.Client, mg resource.Managed, region string) (*aws.Config, error) { //nolint:gocyclo pc := &v1beta1.ProviderConfig{} if err := c.Get(ctx, types.NamespacedName{Name: mg.GetProviderConfigReference().Name}, pc); err != nil { return nil, errors.Wrap(err, "cannot get referenced Provider") @@ -162,7 +160,7 @@ func (a awsEndpointResolverAdaptorWithOptions) ResolveEndpoint(service, region s // SetResolver parses annotations from the managed resource // and returns a configuration accordingly. -func SetResolver(pc *v1beta1.ProviderConfig, cfg *aws.Config) *aws.Config { // nolint:gocyclo +func SetResolver(pc *v1beta1.ProviderConfig, cfg *aws.Config) *aws.Config { //nolint:gocyclo if pc.Spec.Endpoint == nil { return cfg } @@ -416,7 +414,7 @@ func UsePodServiceAccount(ctx context.Context, _ []byte, _, region string) (*aws // GetConfigV1 constructs an *awsv1.Config that can be used to authenticate to AWS // API by the AWSv1 clients. -func GetConfigV1(ctx context.Context, c client.Client, mg resource.Managed, region string) (*session.Session, error) { // nolint:gocyclo +func GetConfigV1(ctx context.Context, c client.Client, mg resource.Managed, region string) (*session.Session, error) { //nolint:gocyclo if mg.GetProviderConfigReference() == nil { return nil, errors.New("providerConfigRef cannot be empty") } @@ -677,7 +675,7 @@ func UsePodServiceAccountV1(ctx context.Context, _ []byte, pc *v1beta1.ProviderC // SetResolverV1 parses annotations from the managed resource // and returns a V1 configuration accordingly. -func SetResolverV1(pc *v1beta1.ProviderConfig, cfg *awsv1.Config) *awsv1.Config { // nolint:gocyclo +func SetResolverV1(pc *v1beta1.ProviderConfig, cfg *awsv1.Config) *awsv1.Config { if pc.Spec.Endpoint == nil { return cfg } diff --git a/pkg/clients/config_test.go b/pkg/clients/config_test.go index 8a417f4062..be9ec95a57 100644 --- a/pkg/clients/config_test.go +++ b/pkg/clients/config_test.go @@ -25,6 +25,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" stscreds "github.com/aws/aws-sdk-go-v2/credentials/stscreds" stscredstypesv2 "github.com/aws/aws-sdk-go-v2/service/sts/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/resource/fake" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" . "github.com/onsi/gomega" @@ -32,10 +35,6 @@ import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/resource/fake" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/v1beta1" ) diff --git a/pkg/clients/database/rds.go b/pkg/clients/database/rds.go index ec7207c280..cae29eb663 100644 --- a/pkg/clients/database/rds.go +++ b/pkg/clients/database/rds.go @@ -26,6 +26,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/rds" rdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" @@ -34,10 +37,6 @@ import ( "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" @@ -421,7 +420,7 @@ func GenerateModifyDBInstanceInput(name string, p *v1beta1.RDSInstanceParameters // GenerateObservation is used to produce v1alpha3.RDSInstanceObservation from // rds.DBInstance. -func GenerateObservation(db rdstypes.DBInstance) v1beta1.RDSInstanceObservation { // nolint:gocyclo +func GenerateObservation(db rdstypes.DBInstance) v1beta1.RDSInstanceObservation { //nolint:gocyclo o := v1beta1.RDSInstanceObservation{ AllocatedStorage: int(db.AllocatedStorage), AWSBackupRecoveryPointARN: aws.ToString(db.AwsBackupRecoveryPointArn), @@ -568,7 +567,7 @@ func GenerateObservation(db rdstypes.DBInstance) v1beta1.RDSInstanceObservation // LateInitialize fills the empty fields in *v1beta1.RDSInstanceParameters with // the values seen in rds.DBInstance. -func LateInitialize(in *v1beta1.RDSInstanceParameters, db *rdstypes.DBInstance) { // nolint:gocyclo +func LateInitialize(in *v1beta1.RDSInstanceParameters, db *rdstypes.DBInstance) { //nolint:gocyclo if db == nil { return } @@ -652,7 +651,7 @@ func LateInitialize(in *v1beta1.RDSInstanceParameters, db *rdstypes.DBInstance) } } // TODO: remove deprecated field + code. Mapping to EnableCloudwatchLogsExports while in deprecation. - // nolint:staticcheck + //nolint:staticcheck if len(in.EnableCloudwatchLogsExports) == 0 && in.CloudwatchLogsExportConfiguration != nil { in.EnableCloudwatchLogsExports = in.CloudwatchLogsExportConfiguration.EnableLogTypes } @@ -680,7 +679,7 @@ func lateInitializeOptionGroupName(inOptionGroupName *string, members []rdstypes } // IsUpToDate checks whether there is a change in any of the modifiable fields. -func IsUpToDate(ctx context.Context, kube client.Client, r *v1beta1.RDSInstance, db rdstypes.DBInstance) (bool, string, error) { // nolint:gocyclo +func IsUpToDate(ctx context.Context, kube client.Client, r *v1beta1.RDSInstance, db rdstypes.DBInstance) (bool, string, error) { _, pwdChanged, err := GetPassword(ctx, kube, r.Spec.ForProvider.MasterPasswordSecretRef, r.Spec.WriteConnectionSecretToReference) if err != nil { return false, "", err diff --git a/pkg/clients/database/rds_test.go b/pkg/clients/database/rds_test.go index a90d82cd99..1ff2802fb7 100644 --- a/pkg/clients/database/rds_test.go +++ b/pkg/clients/database/rds_test.go @@ -22,12 +22,14 @@ import ( "testing" "time" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/rds" rdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" + "github.com/aws/smithy-go/document" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" @@ -36,10 +38,6 @@ import ( "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/clients/dbsubnetgroup/dbsubnetgroup.go b/pkg/clients/dbsubnetgroup/dbsubnetgroup.go index d0b71b8337..bcba4e203f 100644 --- a/pkg/clients/dbsubnetgroup/dbsubnetgroup.go +++ b/pkg/clients/dbsubnetgroup/dbsubnetgroup.go @@ -51,7 +51,7 @@ func IsDBSubnetGroupNotFoundErr(err error) bool { } // IsDBSubnetGroupUpToDate checks whether there is a change in any of the modifiable fields. -func IsDBSubnetGroupUpToDate(p v1beta1.DBSubnetGroupParameters, sg rdstypes.DBSubnetGroup, tags []rdstypes.Tag) bool { // nolint:gocyclo +func IsDBSubnetGroupUpToDate(p v1beta1.DBSubnetGroupParameters, sg rdstypes.DBSubnetGroup, tags []rdstypes.Tag) bool { //nolint:gocyclo if p.Description != awsclients.StringValue(sg.DBSubnetGroupDescription) { return false } diff --git a/pkg/clients/ec2/address.go b/pkg/clients/ec2/address.go index 20099237f4..34017defa2 100644 --- a/pkg/clients/ec2/address.go +++ b/pkg/clients/ec2/address.go @@ -56,7 +56,7 @@ func GenerateAddressObservation(address ec2types.Address) v1beta1.AddressObserva // LateInitializeAddress fills the empty fields in *v1beta1.AddressParameters with // the values seen in ec2types.Address. -func LateInitializeAddress(in *v1beta1.AddressParameters, a *ec2types.Address) { // nolint:gocyclo +func LateInitializeAddress(in *v1beta1.AddressParameters, a *ec2types.Address) { if a == nil { return } diff --git a/pkg/clients/ec2/ec2_test.go b/pkg/clients/ec2/ec2_test.go index 34410e3eac..ddcf966da4 100644 --- a/pkg/clients/ec2/ec2_test.go +++ b/pkg/clients/ec2/ec2_test.go @@ -23,11 +23,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/smithy-go" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/onsi/gomega" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" ) diff --git a/pkg/clients/ec2/instance.go b/pkg/clients/ec2/instance.go index e7b3796f6a..d4ffc2b9d3 100644 --- a/pkg/clients/ec2/instance.go +++ b/pkg/clients/ec2/instance.go @@ -177,7 +177,7 @@ const ( // LateInitializeInstance fills the empty fields in *manualv1alpha1.InstanceParameters with // the values seen in ec2.Instance and ec2.DescribeInstanceAttributeOutput. -func LateInitializeInstance(in *manualv1alpha1.InstanceParameters, instance *types.Instance, attributes *ec2.DescribeInstanceAttributeOutput) { // nolint:gocyclo +func LateInitializeInstance(in *manualv1alpha1.InstanceParameters, instance *types.Instance, attributes *ec2.DescribeInstanceAttributeOutput) { //nolint:gocyclo if instance == nil { return } diff --git a/pkg/clients/ec2/instance_test.go b/pkg/clients/ec2/instance_test.go index c6ff5d963d..9846fb0426 100644 --- a/pkg/clients/ec2/instance_test.go +++ b/pkg/clients/ec2/instance_test.go @@ -20,11 +20,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/smithy-go/document" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" ) diff --git a/pkg/clients/ec2/internetgateway.go b/pkg/clients/ec2/internetgateway.go index 6aad476303..462e264b67 100644 --- a/pkg/clients/ec2/internetgateway.go +++ b/pkg/clients/ec2/internetgateway.go @@ -73,7 +73,7 @@ func GenerateIGObservation(ig ec2types.InternetGateway) v1beta1.InternetGatewayO // LateInitializeIG fills the empty fields in *v1beta1.InternetGatewayParameters with // the values seen in ec2types.InternetGateway. -func LateInitializeIG(in *v1beta1.InternetGatewayParameters, ig *ec2types.InternetGateway) { // nolint:gocyclo +func LateInitializeIG(in *v1beta1.InternetGatewayParameters, ig *ec2types.InternetGateway) { if ig == nil { return } diff --git a/pkg/clients/ec2/natgateway.go b/pkg/clients/ec2/natgateway.go index 3452b88cef..1a1fc59167 100644 --- a/pkg/clients/ec2/natgateway.go +++ b/pkg/clients/ec2/natgateway.go @@ -8,7 +8,6 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/smithy-go" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" diff --git a/pkg/clients/ec2/routetable.go b/pkg/clients/ec2/routetable.go index b4ede4b32e..9a13bdf721 100644 --- a/pkg/clients/ec2/routetable.go +++ b/pkg/clients/ec2/routetable.go @@ -12,11 +12,10 @@ import ( "github.com/aws/aws-sdk-go-v2/service/ec2" ec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/smithy-go" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) @@ -114,7 +113,7 @@ func GenerateRTObservation(rt ec2types.RouteTable) v1beta1.RouteTableObservation // LateInitializeRT fills the empty fields in *v1beta1.RouteTableParameters with // the values seen in ec2.RouteTable. -func LateInitializeRT(in *v1beta1.RouteTableParameters, rt *ec2types.RouteTable) { // nolint:gocyclo +func LateInitializeRT(in *v1beta1.RouteTableParameters, rt *ec2types.RouteTable) { //nolint:gocyclo if rt == nil { return } diff --git a/pkg/clients/ec2/securitygroup.go b/pkg/clients/ec2/securitygroup.go index b9e66fcc58..fa697e1341 100644 --- a/pkg/clients/ec2/securitygroup.go +++ b/pkg/clients/ec2/securitygroup.go @@ -108,7 +108,7 @@ func GenerateSGObservation(sg ec2types.SecurityGroup) v1beta1.SecurityGroupObser // LateInitializeSG fills the empty fields in *v1beta1.SecurityGroupParameters with // the values seen in ec2types.SecurityGroup. -func LateInitializeSG(in *v1beta1.SecurityGroupParameters, sg *ec2types.SecurityGroup) { // nolint:gocyclo +func LateInitializeSG(in *v1beta1.SecurityGroupParameters, sg *ec2types.SecurityGroup) { if sg == nil { return } diff --git a/pkg/clients/ec2/securitygroup_diff.go b/pkg/clients/ec2/securitygroup_diff.go index 9888a85963..22eb19c670 100644 --- a/pkg/clients/ec2/securitygroup_diff.go +++ b/pkg/clients/ec2/securitygroup_diff.go @@ -60,7 +60,7 @@ type ipPermissionMap struct { // merge adds rules from the permission set m into this permission // set. The caller must ensure that the permission set is for the same // protocol and port range. -func (i *ipPermissionMap) merge(m ec2types.IpPermission) { // nolint:gocyclo +func (i *ipPermissionMap) merge(m ec2types.IpPermission) { i.FromPort = m.FromPort i.ToPort = m.ToPort i.IPProtocol = m.IpProtocol diff --git a/pkg/clients/ec2/subnet.go b/pkg/clients/ec2/subnet.go index b2e63a5dad..d926849c86 100644 --- a/pkg/clients/ec2/subnet.go +++ b/pkg/clients/ec2/subnet.go @@ -56,7 +56,7 @@ func GenerateSubnetObservation(subnet ec2types.Subnet) v1beta1.SubnetObservation // LateInitializeSubnet fills the empty fields in *v1beta1.SubnetParameters with // the values seen in ec2types.Subnet. -func LateInitializeSubnet(in *v1beta1.SubnetParameters, s *ec2types.Subnet) { // nolint:gocyclo +func LateInitializeSubnet(in *v1beta1.SubnetParameters, s *ec2types.Subnet) { if s == nil { return } diff --git a/pkg/clients/ec2/tags.go b/pkg/clients/ec2/tags.go index 1ded46f6a0..a120aaa220 100644 --- a/pkg/clients/ec2/tags.go +++ b/pkg/clients/ec2/tags.go @@ -18,7 +18,6 @@ package ec2 import ( "github.com/aws/aws-sdk-go-v2/aws" - ec2type "github.com/aws/aws-sdk-go-v2/service/ec2/types" ) diff --git a/pkg/clients/ec2/vpc.go b/pkg/clients/ec2/vpc.go index 465946dfe7..c204c725b0 100644 --- a/pkg/clients/ec2/vpc.go +++ b/pkg/clients/ec2/vpc.go @@ -102,7 +102,7 @@ func GenerateVpcObservation(vpc ec2types.Vpc) v1beta1.VPCObservation { // LateInitializeVPC fills the empty fields in *v1beta1.VPCParameters with // the values seen in ec2.Vpc and ec2.DescribeVpcAttributeOutput. -func LateInitializeVPC(in *v1beta1.VPCParameters, v *ec2types.Vpc, attributes *ec2.DescribeVpcAttributeOutput) { // nolint:gocyclo +func LateInitializeVPC(in *v1beta1.VPCParameters, v *ec2types.Vpc, attributes *ec2.DescribeVpcAttributeOutput) { if v == nil { return } diff --git a/pkg/clients/ecr/repository.go b/pkg/clients/ecr/repository.go index a53cb2351d..996a6de3f2 100644 --- a/pkg/clients/ecr/repository.go +++ b/pkg/clients/ecr/repository.go @@ -57,7 +57,7 @@ func GenerateRepositoryObservation(repo ecrtypes.Repository) v1beta1.RepositoryO // LateInitializeRepository fills the empty fields in *v1alpha1.RepositoryParameters with // the values seen in ecr.Repository. -func LateInitializeRepository(in *v1beta1.RepositoryParameters, r *ecrtypes.Repository) { // nolint:gocyclo +func LateInitializeRepository(in *v1beta1.RepositoryParameters, r *ecrtypes.Repository) { if r == nil { return } diff --git a/pkg/clients/ecr/repository_policy.go b/pkg/clients/ecr/repository_policy.go index dac77063ae..3704409d61 100644 --- a/pkg/clients/ecr/repository_policy.go +++ b/pkg/clients/ecr/repository_policy.go @@ -39,7 +39,7 @@ func GenerateSetRepositoryPolicyInput(params *v1beta1.RepositoryPolicyParameters // LateInitializeRepositoryPolicy fills the empty fields in *v1alpha1.RepositoryPolicyParameters with // the values seen in ecr.GetRepositoryPolicyResponse. -func LateInitializeRepositoryPolicy(in *v1beta1.RepositoryPolicyParameters, r *ecr.GetRepositoryPolicyOutput) { // nolint:gocyclo +func LateInitializeRepositoryPolicy(in *v1beta1.RepositoryPolicyParameters, r *ecr.GetRepositoryPolicyOutput) { if r == nil { return } @@ -72,7 +72,7 @@ func Serialize(p *v1beta1.RepositoryPolicyBody) (interface{}, error) { } // SerializeRepositoryPolicyStatement is the custom marshaller for the RepositoryPolicyStatement -func SerializeRepositoryPolicyStatement(p v1beta1.RepositoryPolicyStatement) (interface{}, error) { // nolint:gocyclo +func SerializeRepositoryPolicyStatement(p v1beta1.RepositoryPolicyStatement) (interface{}, error) { //nolint:gocyclo m := make(map[string]interface{}) if p.Principal != nil { principal, err := SerializeRepositoryPrincipal(p.Principal) diff --git a/pkg/clients/ecr/repository_test.go b/pkg/clients/ecr/repository_test.go index 8349e97bd5..f9d3654e32 100644 --- a/pkg/clients/ecr/repository_test.go +++ b/pkg/clients/ecr/repository_test.go @@ -5,16 +5,14 @@ import ( "testing" "time" - "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" - - "github.com/aws/smithy-go/document" - "github.com/aws/aws-sdk-go-v2/service/ecr" ecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/clients/eks/eks.go b/pkg/clients/eks/eks.go index 0051ee8f58..0d3b889163 100644 --- a/pkg/clients/eks/eks.go +++ b/pkg/clients/eks/eks.go @@ -21,7 +21,6 @@ import ( "encoding/base64" "encoding/json" "errors" - "net" "github.com/aws/aws-sdk-go-v2/aws" @@ -29,19 +28,17 @@ import ( "github.com/aws/aws-sdk-go-v2/service/eks" ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" "github.com/aws/aws-sdk-go-v2/service/sts" + smithyhttp "github.com/aws/smithy-go/transport/http" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/client-go/tools/clientcmd" clientcmdapi "k8s.io/client-go/tools/clientcmd/api" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - - smithyhttp "github.com/aws/smithy-go/transport/http" ) const ( @@ -235,7 +232,7 @@ func GenerateUpdateClusterConfigInputForVPC(name string, p *v1beta1.ClusterParam // GenerateObservation is used to produce v1beta1.ClusterObservation from // ekstypes.Cluster. -func GenerateObservation(cluster *ekstypes.Cluster) v1beta1.ClusterObservation { // nolint:gocyclo +func GenerateObservation(cluster *ekstypes.Cluster) v1beta1.ClusterObservation { if cluster == nil { return v1beta1.ClusterObservation{} } @@ -289,7 +286,7 @@ func GenerateObservation(cluster *ekstypes.Cluster) v1beta1.ClusterObservation { // LateInitialize fills the empty fields in *v1beta1.ClusterParameters with the // values seen in ekstypes.Cluster. -func LateInitialize(in *v1beta1.ClusterParameters, cluster *ekstypes.Cluster) { // nolint:gocyclo +func LateInitialize(in *v1beta1.ClusterParameters, cluster *ekstypes.Cluster) { //nolint:gocyclo if cluster == nil { return } diff --git a/pkg/clients/eks/eks_test.go b/pkg/clients/eks/eks_test.go index dff583432c..42f1f234e1 100644 --- a/pkg/clients/eks/eks_test.go +++ b/pkg/clients/eks/eks_test.go @@ -20,16 +20,14 @@ import ( "testing" "time" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/eks" ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" + "github.com/aws/smithy-go/document" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" ) diff --git a/pkg/clients/eks/fargateprofile.go b/pkg/clients/eks/fargateprofile.go index 632027f871..0d5da932ed 100644 --- a/pkg/clients/eks/fargateprofile.go +++ b/pkg/clients/eks/fargateprofile.go @@ -50,7 +50,7 @@ func GenerateCreateFargateProfileInput(name string, p v1beta1.FargateProfilePara // GenerateFargateProfileObservation is used to produce FargateProfileObservation // from eks.FargateProfile. -func GenerateFargateProfileObservation(fp *ekstypes.FargateProfile) v1beta1.FargateProfileObservation { // nolint:gocyclo +func GenerateFargateProfileObservation(fp *ekstypes.FargateProfile) v1beta1.FargateProfileObservation { if fp == nil { return v1beta1.FargateProfileObservation{} } @@ -66,7 +66,7 @@ func GenerateFargateProfileObservation(fp *ekstypes.FargateProfile) v1beta1.Farg // LateInitializeFargateProfile fills the empty fields in *FargateProfileParameters with the // values seen in eks.FargateProfile. -func LateInitializeFargateProfile(in *v1beta1.FargateProfileParameters, fp *ekstypes.FargateProfile) { // nolint:gocyclo +func LateInitializeFargateProfile(in *v1beta1.FargateProfileParameters, fp *ekstypes.FargateProfile) { if fp == nil { return } @@ -84,6 +84,6 @@ func LateInitializeFargateProfile(in *v1beta1.FargateProfileParameters, fp *ekst // IsFargateProfileUpToDate checks whether there is a change in the tags. // Any other field is immutable and can't be updated. -func IsFargateProfileUpToDate(p v1beta1.FargateProfileParameters, fp *ekstypes.FargateProfile) bool { // nolint:gocyclo +func IsFargateProfileUpToDate(p v1beta1.FargateProfileParameters, fp *ekstypes.FargateProfile) bool { return cmp.Equal(p.Tags, fp.Tags, cmpopts.EquateEmpty()) } diff --git a/pkg/clients/eks/fargateprofile_test.go b/pkg/clients/eks/fargateprofile_test.go index 8840bc50ea..b35de1761c 100644 --- a/pkg/clients/eks/fargateprofile_test.go +++ b/pkg/clients/eks/fargateprofile_test.go @@ -19,14 +19,13 @@ package eks import ( "testing" - "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" - - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/eks" ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + + "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" ) var ( diff --git a/pkg/clients/eks/identityproviderconfig.go b/pkg/clients/eks/identityproviderconfig.go index 0913ead15f..1cb0d0542b 100644 --- a/pkg/clients/eks/identityproviderconfig.go +++ b/pkg/clients/eks/identityproviderconfig.go @@ -76,13 +76,13 @@ func GenerateIdentityProviderConfigObservation(ip *types.IdentityProviderConfigR // IsIdentityProviderConfigUpToDate checks whether there is a change in the tags. // Any other field is immutable and can't be updated. -func IsIdentityProviderConfigUpToDate(p *manualv1alpha1.IdentityProviderConfigParameters, ip *types.IdentityProviderConfigResponse) bool { // nolint:gocyclo +func IsIdentityProviderConfigUpToDate(p *manualv1alpha1.IdentityProviderConfigParameters, ip *types.IdentityProviderConfigResponse) bool { return cmp.Equal(p.Tags, ip.Oidc.Tags, cmpopts.EquateEmpty()) } // LateInitializeIdentityProviderConfig fills the empty fields in *manualv1alpha1.IdentityProviderConfigParameters with the // values seen in eks.IdentityProviderConfigResponse. -func LateInitializeIdentityProviderConfig(in *manualv1alpha1.IdentityProviderConfigParameters, ip *types.IdentityProviderConfigResponse) { // nolint:gocyclo +func LateInitializeIdentityProviderConfig(in *manualv1alpha1.IdentityProviderConfigParameters, ip *types.IdentityProviderConfigResponse) { if ip == nil { return } diff --git a/pkg/clients/eks/nodegroup.go b/pkg/clients/eks/nodegroup.go index 17c97b800b..621ea979e6 100644 --- a/pkg/clients/eks/nodegroup.go +++ b/pkg/clients/eks/nodegroup.go @@ -186,7 +186,7 @@ func GenerateUpdateNodeGroupConfigInput(name string, p *manualv1alpha1.NodeGroup // GenerateNodeGroupObservation is used to produce manualv1alpha1.NodeGroupObservation // from eks.Nodegroup. -func GenerateNodeGroupObservation(ng *ekstypes.Nodegroup) manualv1alpha1.NodeGroupObservation { // nolint:gocyclo +func GenerateNodeGroupObservation(ng *ekstypes.Nodegroup) manualv1alpha1.NodeGroupObservation { //nolint:gocyclo if ng == nil { return manualv1alpha1.NodeGroupObservation{} } @@ -244,7 +244,7 @@ func GenerateNodeGroupObservation(ng *ekstypes.Nodegroup) manualv1alpha1.NodeGro // LateInitializeNodeGroup fills the empty fields in *manualv1alpha1.NodeGroupParameters with the // values seen in eks.Nodegroup. -func LateInitializeNodeGroup(in *manualv1alpha1.NodeGroupParameters, ng *ekstypes.Nodegroup) { // nolint:gocyclo +func LateInitializeNodeGroup(in *manualv1alpha1.NodeGroupParameters, ng *ekstypes.Nodegroup) { //nolint:gocyclo if ng == nil { return } @@ -306,7 +306,7 @@ func LateInitializeNodeGroup(in *manualv1alpha1.NodeGroupParameters, ng *ekstype } // IsNodeGroupUpToDate checks whether there is a change in any of the modifiable fields. -func IsNodeGroupUpToDate(p *manualv1alpha1.NodeGroupParameters, ng *ekstypes.Nodegroup) bool { // nolint:gocyclo +func IsNodeGroupUpToDate(p *manualv1alpha1.NodeGroupParameters, ng *ekstypes.Nodegroup) bool { //nolint:gocyclo if !cmp.Equal(p.Tags, ng.Tags, cmpopts.EquateEmpty()) { return false } diff --git a/pkg/clients/eks/nodegroup_test.go b/pkg/clients/eks/nodegroup_test.go index f85426774c..d483efc9c1 100644 --- a/pkg/clients/eks/nodegroup_test.go +++ b/pkg/clients/eks/nodegroup_test.go @@ -20,12 +20,11 @@ import ( "testing" "time" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/eks" ekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/eks/manualv1alpha1" diff --git a/pkg/clients/elasticache/elasticache.go b/pkg/clients/elasticache/elasticache.go index 89101573d3..b63a1499c6 100644 --- a/pkg/clients/elasticache/elasticache.go +++ b/pkg/clients/elasticache/elasticache.go @@ -22,8 +22,10 @@ import ( "strconv" "strings" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/service/elasticache" + elasticachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" "github.com/aws/smithy-go/document" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/google/go-cmp/cmp" @@ -31,10 +33,6 @@ import ( "github.com/mitchellh/copystructure" "github.com/pkg/errors" - "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/elasticache" - elasticachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" - cachev1alpha1 "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/cache/v1beta1" clients "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -348,7 +346,7 @@ func ParseVersion(ver *string) (*PartialSemanticVersion, error) { minor, err := strconv.ParseInt(parts[1], 10, 64) // if not a digit (i.e. .x, ignore) if err != nil { - return p, nil // nolint:nilerr + return p, nil //nolint:nilerr } p.Minor = aws.Int64(minor) } @@ -356,7 +354,7 @@ func ParseVersion(ver *string) (*PartialSemanticVersion, error) { if len(parts) > 2 { patch, err := strconv.ParseInt(parts[2], 10, 64) if err != nil { - return p, nil // nolint:nilerr + return p, nil //nolint:nilerr } p.Patch = aws.Int64(patch) } @@ -406,7 +404,7 @@ func versionMatches(kubeVersion *string, awsVersion *string) bool { //nolint: go return true } -func cacheClusterNeedsUpdate(kube v1beta1.ReplicationGroupParameters, cc elasticachetypes.CacheCluster) string { // nolint:gocyclo +func cacheClusterNeedsUpdate(kube v1beta1.ReplicationGroupParameters, cc elasticachetypes.CacheCluster) string { //nolint:gocyclo // AWS will set and return a default version if we don't specify one. if !versionMatches(kube.EngineVersion, cc.EngineVersion) { return "EngineVersion" diff --git a/pkg/clients/elasticache/elasticache_test.go b/pkg/clients/elasticache/elasticache_test.go index 7fd0bba65c..54ccb6a021 100644 --- a/pkg/clients/elasticache/elasticache_test.go +++ b/pkg/clients/elasticache/elasticache_test.go @@ -21,15 +21,14 @@ import ( "strconv" "testing" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - "github.com/aws/aws-sdk-go-v2/service/elasticache" elasticachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" + "github.com/aws/smithy-go/document" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" cachev1alpha1 "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/cache/v1beta1" diff --git a/pkg/clients/elasticache/elasticcachecluster_test.go b/pkg/clients/elasticache/elasticcachecluster_test.go index 39e7686cf8..02cde9f576 100644 --- a/pkg/clients/elasticache/elasticcachecluster_test.go +++ b/pkg/clients/elasticache/elasticcachecluster_test.go @@ -19,12 +19,11 @@ package elasticache import ( "testing" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - awscache "github.com/aws/aws-sdk-go-v2/service/elasticache" awscachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/clients/elasticloadbalancing/elb/elb.go b/pkg/clients/elasticloadbalancing/elb/elb.go index e77d67e3a4..a38e5c26b9 100644 --- a/pkg/clients/elasticloadbalancing/elb/elb.go +++ b/pkg/clients/elasticloadbalancing/elb/elb.go @@ -26,11 +26,10 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" elb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" elbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" clients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) @@ -77,7 +76,7 @@ func GenerateCreateELBInput(name string, p v1alpha1.ELBParameters) *elb.CreateLo // LateInitializeELB fills the empty fields in *v1alpha1.ELBParameters with // the values seen in elasticLoadBalancing.ELB. -func LateInitializeELB(in *v1alpha1.ELBParameters, v *elbtypes.LoadBalancerDescription, elbTags []elbtypes.Tag) { // nolint:gocyclo +func LateInitializeELB(in *v1alpha1.ELBParameters, v *elbtypes.LoadBalancerDescription, elbTags []elbtypes.Tag) { //nolint:gocyclo if v == nil { return } diff --git a/pkg/clients/elasticloadbalancing/elb/elb_test.go b/pkg/clients/elasticloadbalancing/elb/elb_test.go index 1b0c7f5bf0..af2716a12b 100644 --- a/pkg/clients/elasticloadbalancing/elb/elb_test.go +++ b/pkg/clients/elasticloadbalancing/elb/elb_test.go @@ -19,13 +19,12 @@ package elb import ( "testing" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" elb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" elbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" ) diff --git a/pkg/clients/error_test.go b/pkg/clients/error_test.go index cdfd2b9e8c..df28703807 100644 --- a/pkg/clients/error_test.go +++ b/pkg/clients/error_test.go @@ -22,10 +22,9 @@ import ( "github.com/aws/aws-sdk-go-v2/aws/transport/http" "github.com/aws/smithy-go" smithyhttp "github.com/aws/smithy-go/transport/http" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" - - "github.com/crossplane/crossplane-runtime/pkg/test" ) func TestWrap(t *testing.T) { diff --git a/pkg/clients/iam/group.go b/pkg/clients/iam/group.go index 46b82f5582..aa5ea98273 100644 --- a/pkg/clients/iam/group.go +++ b/pkg/clients/iam/group.go @@ -20,7 +20,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/iam" ) diff --git a/pkg/clients/iam/grouppolicyattachment.go b/pkg/clients/iam/grouppolicyattachment.go index 3e6c8c0352..6286841e6d 100644 --- a/pkg/clients/iam/grouppolicyattachment.go +++ b/pkg/clients/iam/grouppolicyattachment.go @@ -4,7 +4,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/iam" ) diff --git a/pkg/clients/iam/groupusermembership.go b/pkg/clients/iam/groupusermembership.go index 6d70691b4a..3763d1d9dd 100644 --- a/pkg/clients/iam/groupusermembership.go +++ b/pkg/clients/iam/groupusermembership.go @@ -4,7 +4,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/iam" ) diff --git a/pkg/clients/iam/iam.go b/pkg/clients/iam/iam.go index 3f603c5b69..7f1b97d59f 100644 --- a/pkg/clients/iam/iam.go +++ b/pkg/clients/iam/iam.go @@ -3,10 +3,10 @@ package iam import ( "errors" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" + + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) // IsErrorNotFound returns true if the error code indicates that the item was not found diff --git a/pkg/clients/iam/openidconnectprovider.go b/pkg/clients/iam/openidconnectprovider.go index 5cf767cb1a..7189b6bf08 100644 --- a/pkg/clients/iam/openidconnectprovider.go +++ b/pkg/clients/iam/openidconnectprovider.go @@ -19,13 +19,13 @@ package iam import ( "context" - svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + + svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) // NewOpenIDConnectProviderClient returns a new client using AWS credentials as JSON encoded data. diff --git a/pkg/clients/iam/openidconnectprovider_test.go b/pkg/clients/iam/openidconnectprovider_test.go index 1bb4a75b78..eca5bd7833 100644 --- a/pkg/clients/iam/openidconnectprovider_test.go +++ b/pkg/clients/iam/openidconnectprovider_test.go @@ -22,9 +22,8 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) diff --git a/pkg/clients/iam/policy.go b/pkg/clients/iam/policy.go index c29a3fe86a..68a85e374a 100644 --- a/pkg/clients/iam/policy.go +++ b/pkg/clients/iam/policy.go @@ -4,13 +4,12 @@ import ( "context" "net/url" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/aws/aws-sdk-go-v2/service/sts" + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" policyutils "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" ) diff --git a/pkg/clients/iam/role.go b/pkg/clients/iam/role.go index d759eabb4d..07bfc28102 100644 --- a/pkg/clients/iam/role.go +++ b/pkg/clients/iam/role.go @@ -5,18 +5,16 @@ import ( "encoding/json" "net/url" - "github.com/aws/smithy-go/document" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" + "github.com/aws/smithy-go/document" + "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/mitchellh/copystructure" "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/clients/iam/role_test.go b/pkg/clients/iam/role_test.go index 9a8a840952..01caf313fb 100644 --- a/pkg/clients/iam/role_test.go +++ b/pkg/clients/iam/role_test.go @@ -5,10 +5,9 @@ import ( "testing" "time" - "github.com/aws/smithy-go/document" - "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" diff --git a/pkg/clients/iam/tags_test.go b/pkg/clients/iam/tags_test.go index 69737b16d0..cca1b5d2f9 100644 --- a/pkg/clients/iam/tags_test.go +++ b/pkg/clients/iam/tags_test.go @@ -4,8 +4,6 @@ import ( "sort" "testing" - "github.com/crossplane-contrib/provider-aws/pkg/clients/iam" - iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/aws/aws-sdk-go/aws" "github.com/aws/smithy-go/document" @@ -13,6 +11,7 @@ import ( "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" + "github.com/crossplane-contrib/provider-aws/pkg/clients/iam" ) func TestDiffIAMTags(t *testing.T) { diff --git a/pkg/clients/iam/user_test.go b/pkg/clients/iam/user_test.go index a6ffcc31c6..540e7c519b 100644 --- a/pkg/clients/iam/user_test.go +++ b/pkg/clients/iam/user_test.go @@ -4,10 +4,10 @@ import ( "testing" "time" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/google/go-cmp/cmp" + + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" ) var ( diff --git a/pkg/clients/iam/userpolicyattachment.go b/pkg/clients/iam/userpolicyattachment.go index 842723445c..9b257a51fb 100644 --- a/pkg/clients/iam/userpolicyattachment.go +++ b/pkg/clients/iam/userpolicyattachment.go @@ -4,7 +4,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/aws/aws-sdk-go-v2/service/iam" ) diff --git a/pkg/clients/mq/mq.go b/pkg/clients/mq/mq.go index 334a8037b1..2e83b49eed 100644 --- a/pkg/clients/mq/mq.go +++ b/pkg/clients/mq/mq.go @@ -19,13 +19,12 @@ package mq import ( "context" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/resource" ) const ( diff --git a/pkg/clients/mq/mq_test.go b/pkg/clients/mq/mq_test.go index 9e8afc98d3..a0eb3456ec 100644 --- a/pkg/clients/mq/mq_test.go +++ b/pkg/clients/mq/mq_test.go @@ -20,15 +20,14 @@ import ( "context" "testing" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" kerrors "k8s.io/apimachinery/pkg/api/errors" "k8s.io/apimachinery/pkg/runtime/schema" "sigs.k8s.io/controller-runtime/pkg/client" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/test" ) var ( diff --git a/pkg/clients/pointer.go b/pkg/clients/pointer.go index 93e5f9f375..4fbe8242ba 100644 --- a/pkg/clients/pointer.go +++ b/pkg/clients/pointer.go @@ -21,7 +21,6 @@ import ( "time" "github.com/aws/aws-sdk-go-v2/aws" - jsonpatch "github.com/evanphx/json-patch" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ) diff --git a/pkg/clients/rds/common.go b/pkg/clients/rds/common.go index 5afcce409a..33e33b800a 100644 --- a/pkg/clients/rds/common.go +++ b/pkg/clients/rds/common.go @@ -20,6 +20,7 @@ import ( "context" "strings" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" @@ -28,8 +29,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" ) // Publicly usable variables diff --git a/pkg/clients/redshift/redshift.go b/pkg/clients/redshift/redshift.go index fc353d2a47..ae328a0068 100644 --- a/pkg/clients/redshift/redshift.go +++ b/pkg/clients/redshift/redshift.go @@ -25,13 +25,11 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/redshift" redshifttypes "github.com/aws/aws-sdk-go-v2/service/redshift/types" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/redshift/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -52,7 +50,7 @@ func NewClient(cfg aws.Config) Client { // LateInitialize fills the empty fields in *v1alpha1.ClusterParameters with // the values seen in redshift.Cluster. -func LateInitialize(in *v1alpha1.ClusterParameters, cl *redshifttypes.Cluster) { // nolint:gocyclo +func LateInitialize(in *v1alpha1.ClusterParameters, cl *redshifttypes.Cluster) { //nolint:gocyclo if cl == nil { return } @@ -129,7 +127,7 @@ func LateInitialize(in *v1alpha1.ClusterParameters, cl *redshifttypes.Cluster) { } // IsUpToDate checks whether there is a change in any of the modifiable fields. -func IsUpToDate(p v1alpha1.ClusterParameters, cl redshifttypes.Cluster) (bool, error) { // nolint:gocyclo +func IsUpToDate(p v1alpha1.ClusterParameters, cl redshifttypes.Cluster) (bool, error) { // We need to check it explicitly as redshift.Cluster can have multiple ClusterParameterGroups found := isClusterParameterGroupNameUpdated(p.ClusterParameterGroupName, cl.ClusterParameterGroups) @@ -328,7 +326,7 @@ func GenerateDeleteClusterInput(p *v1alpha1.ClusterParameters, cid *string) *red // GenerateObservation is used to produce v1alpha1.ClusterObservation from // redshift.Cluster. -func GenerateObservation(in redshifttypes.Cluster) v1alpha1.ClusterObservation { // nolint:gocyclo +func GenerateObservation(in redshifttypes.Cluster) v1alpha1.ClusterObservation { //nolint:gocyclo o := v1alpha1.ClusterObservation{ ClusterPublicKey: aws.ToString(in.ClusterPublicKey), ClusterRevisionNumber: aws.ToString(in.ClusterRevisionNumber), diff --git a/pkg/clients/redshift/redshift_test.go b/pkg/clients/redshift/redshift_test.go index c2b509caae..e1966e6d32 100644 --- a/pkg/clients/redshift/redshift_test.go +++ b/pkg/clients/redshift/redshift_test.go @@ -20,14 +20,13 @@ import ( "errors" "testing" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/redshift" redshifttypes "github.com/aws/aws-sdk-go-v2/service/redshift/types" "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/redshift/v1alpha1" ) diff --git a/pkg/clients/resolverruleassociation/resolverruleassociation.go b/pkg/clients/resolverruleassociation/resolverruleassociation.go index e7afa75a0a..bcc92f24cc 100644 --- a/pkg/clients/resolverruleassociation/resolverruleassociation.go +++ b/pkg/clients/resolverruleassociation/resolverruleassociation.go @@ -20,11 +20,10 @@ import ( "context" "errors" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/aws/aws-sdk-go-v2/aws" route53resolver "github.com/aws/aws-sdk-go-v2/service/route53resolver" route53resolvertypes "github.com/aws/aws-sdk-go-v2/service/route53resolver/types" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane-contrib/provider-aws/apis/route53resolver/manualv1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/clients/resourcerecordset/resourcerecordset.go b/pkg/clients/resourcerecordset/resourcerecordset.go index de56e5b9f8..6efaa73b98 100644 --- a/pkg/clients/resourcerecordset/resourcerecordset.go +++ b/pkg/clients/resourcerecordset/resourcerecordset.go @@ -26,15 +26,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/route53" route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/crossplane-contrib/provider-aws/pkg/clients/hostedzone" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane-contrib/provider-aws/apis/route53/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/clients/hostedzone" ) const ( diff --git a/pkg/clients/s3/bucket.go b/pkg/clients/s3/bucket.go index cb08dded7e..6ed468b022 100644 --- a/pkg/clients/s3/bucket.go +++ b/pkg/clients/s3/bucket.go @@ -105,8 +105,8 @@ type BucketClient interface { PutBucketNotificationConfiguration(ctx context.Context, input *s3.PutBucketNotificationConfigurationInput, opts ...func(*s3.Options)) (*s3.PutBucketNotificationConfigurationOutput, error) GetBucketNotificationConfiguration(ctx context.Context, input *s3.GetBucketNotificationConfigurationInput, opts ...func(*s3.Options)) (*s3.GetBucketNotificationConfigurationOutput, error) - GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput, opts ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) //nolint - PutBucketAcl(ctx context.Context, input *s3.PutBucketAclInput, opts ...func(*s3.Options)) (*s3.PutBucketAclOutput, error) //nolint + GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput, opts ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) + PutBucketAcl(ctx context.Context, input *s3.PutBucketAclInput, opts ...func(*s3.Options)) (*s3.PutBucketAclOutput, error) GetPublicAccessBlock(ctx context.Context, input *s3.GetPublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error) PutPublicAccessBlock(ctx context.Context, input *s3.PutPublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.PutPublicAccessBlockOutput, error) DeletePublicAccessBlock(ctx context.Context, input *s3.DeletePublicAccessBlockInput, opts ...func(*s3.Options)) (*s3.DeletePublicAccessBlockOutput, error) diff --git a/pkg/clients/s3/bucketpolicy.go b/pkg/clients/s3/bucketpolicy.go index a7f15b68c2..572420c6e4 100644 --- a/pkg/clients/s3/bucketpolicy.go +++ b/pkg/clients/s3/bucketpolicy.go @@ -119,7 +119,7 @@ func Serialize(p *common.BucketPolicyBody) (interface{}, error) { } // SerializeBucketPolicyStatement is the custom marshaller for the BucketPolicyStatement -func SerializeBucketPolicyStatement(p common.BucketPolicyStatement) (interface{}, error) { // nolint:gocyclo +func SerializeBucketPolicyStatement(p common.BucketPolicyStatement) (interface{}, error) { //nolint:gocyclo m := make(map[string]interface{}) if p.Principal != nil { principal, err := SerializeBucketPrincipal(p.Principal) diff --git a/pkg/clients/s3/fake/bucket.go b/pkg/clients/s3/fake/bucket.go index 14efd5554f..373d16caaf 100644 --- a/pkg/clients/s3/fake/bucket.go +++ b/pkg/clients/s3/fake/bucket.go @@ -75,8 +75,8 @@ type MockBucketClient struct { MockPutBucketNotificationConfiguration func(ctx context.Context, input *s3.PutBucketNotificationConfigurationInput, opts []func(*s3.Options)) (*s3.PutBucketNotificationConfigurationOutput, error) MockGetBucketNotificationConfiguration func(ctx context.Context, input *s3.GetBucketNotificationConfigurationInput, opts []func(*s3.Options)) (*s3.GetBucketNotificationConfigurationOutput, error) - MockGetBucketAcl func(ctx context.Context, input *s3.GetBucketAclInput, opts []func(*s3.Options)) (*s3.GetBucketAclOutput, error) //nolint - MockPutBucketAcl func(ctx context.Context, input *s3.PutBucketAclInput, opts []func(*s3.Options)) (*s3.PutBucketAclOutput, error) //nolint + MockGetBucketAcl func(ctx context.Context, input *s3.GetBucketAclInput, opts []func(*s3.Options)) (*s3.GetBucketAclOutput, error) + MockPutBucketAcl func(ctx context.Context, input *s3.PutBucketAclInput, opts []func(*s3.Options)) (*s3.PutBucketAclOutput, error) MockGetPublicAccessBlock func(ctx context.Context, input *s3.GetPublicAccessBlockInput, opts []func(*s3.Options)) (*s3.GetPublicAccessBlockOutput, error) MockPutPublicAccessBlock func(ctx context.Context, input *s3.PutPublicAccessBlockInput, opts []func(*s3.Options)) (*s3.PutPublicAccessBlockOutput, error) @@ -255,12 +255,12 @@ func (m MockBucketClient) GetBucketNotificationConfiguration(ctx context.Context } // GetBucketAcl is the fake method call to invoke the internal mock method -func (m MockBucketClient) GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput, opts ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) { //nolint +func (m MockBucketClient) GetBucketAcl(ctx context.Context, input *s3.GetBucketAclInput, opts ...func(*s3.Options)) (*s3.GetBucketAclOutput, error) { return m.MockGetBucketAcl(ctx, input, opts) } // PutBucketAcl is the fake method call to invoke the internal mock method -func (m MockBucketClient) PutBucketAcl(ctx context.Context, input *s3.PutBucketAclInput, opts ...func(*s3.Options)) (*s3.PutBucketAclOutput, error) { //nolint +func (m MockBucketClient) PutBucketAcl(ctx context.Context, input *s3.PutBucketAclInput, opts ...func(*s3.Options)) (*s3.PutBucketAclOutput, error) { return m.MockPutBucketAcl(ctx, input, opts) } diff --git a/pkg/clients/servicediscovery/fake/fake.go b/pkg/clients/servicediscovery/fake/fake.go index 182dd6edea..1af8576b95 100644 --- a/pkg/clients/servicediscovery/fake/fake.go +++ b/pkg/clients/servicediscovery/fake/fake.go @@ -45,7 +45,7 @@ type MockServicediscoveryClient struct { } // CreatePrivateDnsNamespace is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePrivateDnsNamespace(input *svcsdk.CreatePrivateDnsNamespaceInput) (*svcsdk.CreatePrivateDnsNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePrivateDnsNamespace(input *svcsdk.CreatePrivateDnsNamespaceInput) (*svcsdk.CreatePrivateDnsNamespaceOutput, error) { if m.MockCreatePrivateDNSNamespace == nil { fmt.Println(".MockCreatePrivateDNSNamespace == nil") return &svcsdk.CreatePrivateDnsNamespaceOutput{}, nil @@ -54,7 +54,7 @@ func (m *MockServicediscoveryClient) CreatePrivateDnsNamespace(input *svcsdk.Cre } // CreatePublicDnsNamespace is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePublicDnsNamespace(input *svcsdk.CreatePublicDnsNamespaceInput) (*svcsdk.CreatePublicDnsNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePublicDnsNamespace(input *svcsdk.CreatePublicDnsNamespaceInput) (*svcsdk.CreatePublicDnsNamespaceOutput, error) { if m.MockCreatePublicDNSNamespace == nil { fmt.Println(".MockCreatePublicDNSNamespace == nil") return &svcsdk.CreatePublicDnsNamespaceOutput{}, nil @@ -63,7 +63,7 @@ func (m *MockServicediscoveryClient) CreatePublicDnsNamespace(input *svcsdk.Crea } // CreateHttpNamespace is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreateHttpNamespace(input *svcsdk.CreateHttpNamespaceInput) (*svcsdk.CreateHttpNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreateHttpNamespace(input *svcsdk.CreateHttpNamespaceInput) (*svcsdk.CreateHttpNamespaceOutput, error) { if m.MockCreateHTTPNamespace == nil { fmt.Println(".MockCreateHTTPNamespace == nil") return &svcsdk.CreateHttpNamespaceOutput{}, nil @@ -72,7 +72,7 @@ func (m *MockServicediscoveryClient) CreateHttpNamespace(input *svcsdk.CreateHtt } // CreatePrivateDnsNamespaceWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceWithContext(_ context.Context, input *svcsdk.CreatePrivateDnsNamespaceInput, _ ...request.Option) (*svcsdk.CreatePrivateDnsNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceWithContext(_ context.Context, input *svcsdk.CreatePrivateDnsNamespaceInput, _ ...request.Option) (*svcsdk.CreatePrivateDnsNamespaceOutput, error) { if m.MockCreatePrivateDNSNamespace == nil { fmt.Println(".MockCreatePrivateDNSNamespace == nil") return &svcsdk.CreatePrivateDnsNamespaceOutput{}, nil @@ -81,7 +81,7 @@ func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceWithContext(_ cont } // CreatePublicDnsNamespaceWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceWithContext(_ context.Context, input *svcsdk.CreatePublicDnsNamespaceInput, _ ...request.Option) (*svcsdk.CreatePublicDnsNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceWithContext(_ context.Context, input *svcsdk.CreatePublicDnsNamespaceInput, _ ...request.Option) (*svcsdk.CreatePublicDnsNamespaceOutput, error) { //nolint:golint if m.MockCreatePublicDNSNamespace == nil { fmt.Println(".MockCreatePublicDnsNamespace == nil") return &svcsdk.CreatePublicDnsNamespaceOutput{}, nil @@ -90,7 +90,7 @@ func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceWithContext(_ conte } // CreateHttpNamespaceWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreateHttpNamespaceWithContext(_ context.Context, input *svcsdk.CreateHttpNamespaceInput, _ ...request.Option) (*svcsdk.CreateHttpNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) CreateHttpNamespaceWithContext(_ context.Context, input *svcsdk.CreateHttpNamespaceInput, _ ...request.Option) (*svcsdk.CreateHttpNamespaceOutput, error) { //nolint:golint if m.MockCreateHTTPNamespace == nil { fmt.Println(".MockCreateHTTPNamespace == nil") return &svcsdk.CreateHttpNamespaceOutput{}, nil @@ -99,7 +99,7 @@ func (m *MockServicediscoveryClient) CreateHttpNamespaceWithContext(_ context.Co } // GetOperation is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetOperation(input *svcsdk.GetOperationInput) (*svcsdk.GetOperationOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) GetOperation(input *svcsdk.GetOperationInput) (*svcsdk.GetOperationOutput, error) { //nolint:golint if m.MockGetOperation == nil { fmt.Println(".MockGetOperation == nil") return &svcsdk.GetOperationOutput{}, nil @@ -108,7 +108,7 @@ func (m *MockServicediscoveryClient) GetOperation(input *svcsdk.GetOperationInpu } // GetOperationWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetOperationWithContext(_ context.Context, input *svcsdk.GetOperationInput, _ ...request.Option) (*svcsdk.GetOperationOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) GetOperationWithContext(_ context.Context, input *svcsdk.GetOperationInput, _ ...request.Option) (*svcsdk.GetOperationOutput, error) { //nolint:golint if m.MockGetOperation == nil { fmt.Println(".MockGetOperation == nil") return &svcsdk.GetOperationOutput{}, nil @@ -117,7 +117,7 @@ func (m *MockServicediscoveryClient) GetOperationWithContext(_ context.Context, } // GetNamespace is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetNamespace(input *svcsdk.GetNamespaceInput) (*svcsdk.GetNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) GetNamespace(input *svcsdk.GetNamespaceInput) (*svcsdk.GetNamespaceOutput, error) { //nolint:golint if m.MockGetNamespace == nil { fmt.Println(".MockGetNamespace == nil") return &svcsdk.GetNamespaceOutput{}, nil @@ -126,7 +126,7 @@ func (m *MockServicediscoveryClient) GetNamespace(input *svcsdk.GetNamespaceInpu } // GetNamespaceWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetNamespaceWithContext(_ context.Context, input *svcsdk.GetNamespaceInput, _ ...request.Option) (*svcsdk.GetNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) GetNamespaceWithContext(_ context.Context, input *svcsdk.GetNamespaceInput, _ ...request.Option) (*svcsdk.GetNamespaceOutput, error) { //nolint:golint if m.MockGetNamespace == nil { fmt.Println(".MockGetNamespace == nil") return &svcsdk.GetNamespaceOutput{}, nil @@ -135,7 +135,7 @@ func (m *MockServicediscoveryClient) GetNamespaceWithContext(_ context.Context, } // DeleteNamespace is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) DeleteNamespace(input *svcsdk.DeleteNamespaceInput) (*svcsdk.DeleteNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) DeleteNamespace(input *svcsdk.DeleteNamespaceInput) (*svcsdk.DeleteNamespaceOutput, error) { //nolint:golint if m.MockDeleteNamespace == nil { fmt.Println(".MockDeleteNamespace == nil") return &svcsdk.DeleteNamespaceOutput{}, nil @@ -144,7 +144,7 @@ func (m *MockServicediscoveryClient) DeleteNamespace(input *svcsdk.DeleteNamespa } // DeleteNamespaceWithContext is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) DeleteNamespaceWithContext(_ context.Context, input *svcsdk.DeleteNamespaceInput, _ ...request.Option) (*svcsdk.DeleteNamespaceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) DeleteNamespaceWithContext(_ context.Context, input *svcsdk.DeleteNamespaceInput, _ ...request.Option) (*svcsdk.DeleteNamespaceOutput, error) { //nolint:golint if m.MockDeleteNamespace == nil { fmt.Println(".MockDeleteNamespace == nil") return &svcsdk.DeleteNamespaceOutput{}, nil @@ -153,7 +153,7 @@ func (m *MockServicediscoveryClient) DeleteNamespaceWithContext(_ context.Contex } // CreatePrivateDnsNamespaceRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceRequest(input *svcsdk.CreatePrivateDnsNamespaceInput) (*request.Request, *svcsdk.CreatePrivateDnsNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceRequest(input *svcsdk.CreatePrivateDnsNamespaceInput) (*request.Request, *svcsdk.CreatePrivateDnsNamespaceOutput) { if m.MockCreatePrivateDNSNamespaceRequest == nil { fmt.Println(".MockCreatePrivateDNSNamespaceRequest == nil") return &request.Request{}, nil @@ -162,7 +162,7 @@ func (m *MockServicediscoveryClient) CreatePrivateDnsNamespaceRequest(input *svc } // CreatePublicDnsNamespaceRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceRequest(input *svcsdk.CreatePublicDnsNamespaceInput) (*request.Request, *svcsdk.CreatePublicDnsNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceRequest(input *svcsdk.CreatePublicDnsNamespaceInput) (*request.Request, *svcsdk.CreatePublicDnsNamespaceOutput) { if m.MockCreatePublicDNSNamespaceRequest == nil { fmt.Println(".MockCreatePublicDNSNamespaceRequest == nil") return &request.Request{}, nil @@ -171,7 +171,7 @@ func (m *MockServicediscoveryClient) CreatePublicDnsNamespaceRequest(input *svcs } // CreateHttpNamespaceRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) CreateHttpNamespaceRequest(input *svcsdk.CreateHttpNamespaceInput) (*request.Request, *svcsdk.CreateHttpNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) CreateHttpNamespaceRequest(input *svcsdk.CreateHttpNamespaceInput) (*request.Request, *svcsdk.CreateHttpNamespaceOutput) { if m.MockCreateHTTPNamespaceRequest == nil { fmt.Println(".MockCreateHTTPNamespaceRequest == nil") return &request.Request{}, nil @@ -180,7 +180,7 @@ func (m *MockServicediscoveryClient) CreateHttpNamespaceRequest(input *svcsdk.Cr } // GetOperationRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetOperationRequest(input *svcsdk.GetOperationInput) (*request.Request, *svcsdk.GetOperationOutput) { // nolint:golint +func (m *MockServicediscoveryClient) GetOperationRequest(input *svcsdk.GetOperationInput) (*request.Request, *svcsdk.GetOperationOutput) { //nolint:golint if m.MockGetOperationRequest == nil { fmt.Println(".MockGetOperationRequest == nil") return &request.Request{}, nil @@ -189,7 +189,7 @@ func (m *MockServicediscoveryClient) GetOperationRequest(input *svcsdk.GetOperat } // GetOperationWithContextRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetOperationWithContextRequest(_ context.Context, input *svcsdk.GetOperationInput) (*request.Request, *svcsdk.GetOperationOutput) { // nolint:golint +func (m *MockServicediscoveryClient) GetOperationWithContextRequest(_ context.Context, input *svcsdk.GetOperationInput) (*request.Request, *svcsdk.GetOperationOutput) { //nolint:golint if m.MockGetOperationRequest == nil { fmt.Println(".MockGetOperationRequest == nil") return &request.Request{}, nil @@ -198,7 +198,7 @@ func (m *MockServicediscoveryClient) GetOperationWithContextRequest(_ context.Co } // GetNamespaceRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetNamespaceRequest(input *svcsdk.GetNamespaceInput) (*request.Request, *svcsdk.GetNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) GetNamespaceRequest(input *svcsdk.GetNamespaceInput) (*request.Request, *svcsdk.GetNamespaceOutput) { //nolint:golint if m.MockGetNamespaceRequest == nil { fmt.Println(".MockGetNamespaceRequest == nil") return &request.Request{}, nil @@ -207,7 +207,7 @@ func (m *MockServicediscoveryClient) GetNamespaceRequest(input *svcsdk.GetNamesp } // GetNamespaceWithContextRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) GetNamespaceWithContextRequest(_ context.Context, input *svcsdk.GetNamespaceInput) (*request.Request, *svcsdk.GetNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) GetNamespaceWithContextRequest(_ context.Context, input *svcsdk.GetNamespaceInput) (*request.Request, *svcsdk.GetNamespaceOutput) { //nolint:golint if m.MockGetNamespaceRequest == nil { return &request.Request{}, nil } @@ -215,7 +215,7 @@ func (m *MockServicediscoveryClient) GetNamespaceWithContextRequest(_ context.Co } // DeleteNamespaceRequest is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) DeleteNamespaceRequest(input *svcsdk.DeleteNamespaceInput) (*request.Request, *svcsdk.DeleteNamespaceOutput) { // nolint:golint +func (m *MockServicediscoveryClient) DeleteNamespaceRequest(input *svcsdk.DeleteNamespaceInput) (*request.Request, *svcsdk.DeleteNamespaceOutput) { //nolint:golint if m.MockDeleteNamespaceRequest == nil { return &request.Request{}, nil } @@ -223,7 +223,7 @@ func (m *MockServicediscoveryClient) DeleteNamespaceRequest(input *svcsdk.Delete } // ListTagsForResource is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) ListTagsForResource(input *svcsdk.ListTagsForResourceInput) (*svcsdk.ListTagsForResourceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) ListTagsForResource(input *svcsdk.ListTagsForResourceInput) (*svcsdk.ListTagsForResourceOutput, error) { //nolint:golint if m.MockListTagsForResource == nil { return &svcsdk.ListTagsForResourceOutput{}, nil } @@ -231,7 +231,7 @@ func (m *MockServicediscoveryClient) ListTagsForResource(input *svcsdk.ListTagsF } // UntagResource is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) UntagResource(input *svcsdk.UntagResourceInput) (*svcsdk.UntagResourceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) UntagResource(input *svcsdk.UntagResourceInput) (*svcsdk.UntagResourceOutput, error) { //nolint:golint if m.MockUntagResource == nil { return &svcsdk.UntagResourceOutput{}, nil } @@ -239,7 +239,7 @@ func (m *MockServicediscoveryClient) UntagResource(input *svcsdk.UntagResourceIn } // TagResource is the interface function to call the mock function pointer -func (m *MockServicediscoveryClient) TagResource(input *svcsdk.TagResourceInput) (*svcsdk.TagResourceOutput, error) { // nolint:golint +func (m *MockServicediscoveryClient) TagResource(input *svcsdk.TagResourceInput) (*svcsdk.TagResourceOutput, error) { //nolint:golint if m.MockTagResource == nil { return &svcsdk.TagResourceOutput{}, nil } diff --git a/pkg/clients/sns/subscription.go b/pkg/clients/sns/subscription.go index fb989ca4ce..3aa86b2b67 100644 --- a/pkg/clients/sns/subscription.go +++ b/pkg/clients/sns/subscription.go @@ -21,12 +21,12 @@ import ( "errors" "strconv" - "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" - awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sns" snstypes "github.com/aws/aws-sdk-go-v2/service/sns/types" + + "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" + awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) // SubscriptionAttributes refers to AWS SNS Subscription Attributes List diff --git a/pkg/clients/sns/topic.go b/pkg/clients/sns/topic.go index 4e4683129c..de9128f8c4 100644 --- a/pkg/clients/sns/topic.go +++ b/pkg/clients/sns/topic.go @@ -21,13 +21,13 @@ import ( "errors" "strconv" - "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" - awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" - policyutils "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sns" snstypes "github.com/aws/aws-sdk-go-v2/service/sns/types" + + "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" + awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" + policyutils "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" ) // TopicAttributes refers to AWS SNS Topic Attributes List diff --git a/pkg/clients/sns/topic_test.go b/pkg/clients/sns/topic_test.go index 1d0eef9da6..235aa9eb0a 100644 --- a/pkg/clients/sns/topic_test.go +++ b/pkg/clients/sns/topic_test.go @@ -20,16 +20,14 @@ import ( "strconv" "testing" - "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" - - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" awssns "github.com/aws/aws-sdk-go-v2/service/sns" awssnstypes "github.com/aws/aws-sdk-go-v2/service/sns/types" + "github.com/aws/smithy-go/document" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/clients/sqs/queue.go b/pkg/clients/sqs/queue.go index 3f789394bd..ac32164d70 100644 --- a/pkg/clients/sqs/queue.go +++ b/pkg/clients/sqs/queue.go @@ -24,15 +24,13 @@ import ( "strings" "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/sqs" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/google/go-cmp/cmp" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/sqs/v1beta1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -75,7 +73,7 @@ func GenerateCreateAttributes(p *v1beta1.QueueParameters) map[string]string { } // GenerateQueueAttributes returns a map of queue attributes -func GenerateQueueAttributes(p *v1beta1.QueueParameters) map[string]string { // nolint:gocyclo +func GenerateQueueAttributes(p *v1beta1.QueueParameters) map[string]string { //nolint:gocyclo m := map[string]string{} if p.DelaySeconds != nil { m[v1beta1.AttributeDelaySeconds] = strconv.FormatInt(aws.ToInt64(p.DelaySeconds), 10) @@ -182,7 +180,7 @@ func LateInitialize(in *v1beta1.QueueParameters, attributes map[string]string, t } // IsUpToDate checks whether there is a change in any of the modifiable fields. -func IsUpToDate(p v1beta1.QueueParameters, attributes map[string]string, tags map[string]string) bool { // nolint:gocyclo +func IsUpToDate(p v1beta1.QueueParameters, attributes map[string]string, tags map[string]string) bool { //nolint:gocyclo if len(p.Tags) != len(tags) { return false } diff --git a/pkg/clients/sqs/queue_test.go b/pkg/clients/sqs/queue_test.go index 59883492a1..8c184cca05 100644 --- a/pkg/clients/sqs/queue_test.go +++ b/pkg/clients/sqs/queue_test.go @@ -21,10 +21,9 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/google/go-cmp/cmp" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/google/go-cmp/cmp" "github.com/crossplane-contrib/provider-aws/apis/sqs/v1beta1" ) diff --git a/pkg/clients/tags_test.go b/pkg/clients/tags_test.go index 3048f5285b..2a584547c9 100644 --- a/pkg/clients/tags_test.go +++ b/pkg/clients/tags_test.go @@ -19,10 +19,9 @@ package aws import ( "testing" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - - "github.com/crossplane/crossplane-runtime/pkg/test" ) func TestDiffTags(t *testing.T) { diff --git a/pkg/controller/acm/controller.go b/pkg/controller/acm/controller.go index 198de0ac91..20b77fefb2 100644 --- a/pkg/controller/acm/controller.go +++ b/pkg/controller/acm/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsacm "github.com/aws/aws-sdk-go-v2/service/acm" awsacmtypes "github.com/aws/aws-sdk-go-v2/service/acm/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -179,7 +178,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { cr, ok := mgd.(*v1beta1.Certificate) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/acm/controller_test.go b/pkg/controller/acm/controller_test.go index a1fe78df3d..55484e4cd0 100644 --- a/pkg/controller/acm/controller_test.go +++ b/pkg/controller/acm/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsacm "github.com/aws/aws-sdk-go-v2/service/acm" awsacmtype "github.com/aws/aws-sdk-go-v2/service/acm/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/acm/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/acm/setup.go b/pkg/controller/acm/setup.go index a45779f578..5bbf996bd5 100644 --- a/pkg/controller/acm/setup.go +++ b/pkg/controller/acm/setup.go @@ -17,9 +17,8 @@ limitations under the License. package acm import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" ) diff --git a/pkg/controller/acmpca/certificateauthority/controller.go b/pkg/controller/acmpca/certificateauthority/controller.go index 7b7b778ae9..a33a498b4b 100644 --- a/pkg/controller/acmpca/certificateauthority/controller.go +++ b/pkg/controller/acmpca/certificateauthority/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsacmpca "github.com/aws/aws-sdk-go-v2/service/acmpca" awsacmpcatypes "github.com/aws/aws-sdk-go-v2/service/acmpca/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/acmpca/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -114,7 +113,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.CertificateAuthority) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -183,7 +182,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { cr, ok := mgd.(*v1beta1.CertificateAuthority) if !ok { diff --git a/pkg/controller/acmpca/certificateauthority/controller_test.go b/pkg/controller/acmpca/certificateauthority/controller_test.go index d8b782954c..9a5e97c646 100644 --- a/pkg/controller/acmpca/certificateauthority/controller_test.go +++ b/pkg/controller/acmpca/certificateauthority/controller_test.go @@ -18,26 +18,22 @@ package certificateauthority import ( "context" - "testing" - "sigs.k8s.io/controller-runtime/pkg/client" - - "github.com/crossplane-contrib/provider-aws/apis/acmpca/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" awsacmpca "github.com/aws/aws-sdk-go-v2/service/acmpca" awsacmpcatypes "github.com/aws/aws-sdk-go-v2/service/acmpca/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/crossplane-contrib/provider-aws/apis/acmpca/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" acmpca "github.com/crossplane-contrib/provider-aws/pkg/clients/acmpca" "github.com/crossplane-contrib/provider-aws/pkg/clients/acmpca/fake" diff --git a/pkg/controller/acmpca/certificateauthoritypermission/controller.go b/pkg/controller/acmpca/certificateauthoritypermission/controller.go index 41dcce2f3b..84caadba4a 100644 --- a/pkg/controller/acmpca/certificateauthoritypermission/controller.go +++ b/pkg/controller/acmpca/certificateauthoritypermission/controller.go @@ -23,10 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsacmpca "github.com/aws/aws-sdk-go-v2/service/acmpca" awsacmpcatypes "github.com/aws/aws-sdk-go-v2/service/acmpca/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +30,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/acmpca/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/acmpca/certificateauthoritypermission/controller_test.go b/pkg/controller/acmpca/certificateauthoritypermission/controller_test.go index 5bfebb4861..076013ed58 100644 --- a/pkg/controller/acmpca/certificateauthoritypermission/controller_test.go +++ b/pkg/controller/acmpca/certificateauthoritypermission/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsacmpca "github.com/aws/aws-sdk-go-v2/service/acmpca" awsacmpcatypes "github.com/aws/aws-sdk-go-v2/service/acmpca/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/acmpca/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/acmpca/setup.go b/pkg/controller/acmpca/setup.go index a5add71d9a..c7f66ea42a 100644 --- a/pkg/controller/acmpca/setup.go +++ b/pkg/controller/acmpca/setup.go @@ -17,9 +17,8 @@ limitations under the License. package acmpca import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthority" "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca/certificateauthoritypermission" diff --git a/pkg/controller/apigateway/setup.go b/pkg/controller/apigateway/setup.go index ea23ebdf4f..06987f72b8 100644 --- a/pkg/controller/apigateway/setup.go +++ b/pkg/controller/apigateway/setup.go @@ -17,9 +17,8 @@ limitations under the License. package apigateway import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/method" "github.com/crossplane-contrib/provider-aws/pkg/controller/apigateway/resource" diff --git a/pkg/controller/apigatewayv2/api/setup.go b/pkg/controller/apigatewayv2/api/setup.go index 2a7cd1c492..a30a8905a7 100644 --- a/pkg/controller/apigatewayv2/api/setup.go +++ b/pkg/controller/apigatewayv2/api/setup.go @@ -20,16 +20,14 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/apimapping/setup.go b/pkg/controller/apigatewayv2/apimapping/setup.go index 5906fab017..2975399fd4 100644 --- a/pkg/controller/apigatewayv2/apimapping/setup.go +++ b/pkg/controller/apigatewayv2/apimapping/setup.go @@ -20,16 +20,14 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/authorizer/setup.go b/pkg/controller/apigatewayv2/authorizer/setup.go index 9a39d611b6..0b9c9d9d67 100644 --- a/pkg/controller/apigatewayv2/authorizer/setup.go +++ b/pkg/controller/apigatewayv2/authorizer/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/deployment/setup.go b/pkg/controller/apigatewayv2/deployment/setup.go index bfcc876e62..94eb906ca7 100644 --- a/pkg/controller/apigatewayv2/deployment/setup.go +++ b/pkg/controller/apigatewayv2/deployment/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/domainname/setup.go b/pkg/controller/apigatewayv2/domainname/setup.go index 5a727b9466..33711170c4 100644 --- a/pkg/controller/apigatewayv2/domainname/setup.go +++ b/pkg/controller/apigatewayv2/domainname/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/integration/setup.go b/pkg/controller/apigatewayv2/integration/setup.go index 254b969a02..509a4849ad 100644 --- a/pkg/controller/apigatewayv2/integration/setup.go +++ b/pkg/controller/apigatewayv2/integration/setup.go @@ -21,8 +21,6 @@ import ( "fmt" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -30,6 +28,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/integrationresponse/setup.go b/pkg/controller/apigatewayv2/integrationresponse/setup.go index 95a6b0df6f..0cfd0b3b21 100644 --- a/pkg/controller/apigatewayv2/integrationresponse/setup.go +++ b/pkg/controller/apigatewayv2/integrationresponse/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/model/setup.go b/pkg/controller/apigatewayv2/model/setup.go index 55377270a9..88beb55cda 100644 --- a/pkg/controller/apigatewayv2/model/setup.go +++ b/pkg/controller/apigatewayv2/model/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/route/setup.go b/pkg/controller/apigatewayv2/route/setup.go index 831a493f7c..a8a556ad2e 100644 --- a/pkg/controller/apigatewayv2/route/setup.go +++ b/pkg/controller/apigatewayv2/route/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/routeresponse/setup.go b/pkg/controller/apigatewayv2/routeresponse/setup.go index 6d5483cfc3..63b63ec456 100644 --- a/pkg/controller/apigatewayv2/routeresponse/setup.go +++ b/pkg/controller/apigatewayv2/routeresponse/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/setup.go b/pkg/controller/apigatewayv2/setup.go index 714cc57f49..73944ffbff 100644 --- a/pkg/controller/apigatewayv2/setup.go +++ b/pkg/controller/apigatewayv2/setup.go @@ -17,9 +17,8 @@ limitations under the License. package apigatewayv2 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/api" "github.com/crossplane-contrib/provider-aws/pkg/controller/apigatewayv2/apimapping" diff --git a/pkg/controller/apigatewayv2/stage/setup.go b/pkg/controller/apigatewayv2/stage/setup.go index 2afb0ee54c..4f9db792c0 100644 --- a/pkg/controller/apigatewayv2/stage/setup.go +++ b/pkg/controller/apigatewayv2/stage/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/apigatewayv2/vpclink/setup.go b/pkg/controller/apigatewayv2/vpclink/setup.go index 71ea7ef046..fa508f241b 100644 --- a/pkg/controller/apigatewayv2/vpclink/setup.go +++ b/pkg/controller/apigatewayv2/vpclink/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/apigatewayv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/athena/setup.go b/pkg/controller/athena/setup.go index 24feabd2f4..adeee318be 100644 --- a/pkg/controller/athena/setup.go +++ b/pkg/controller/athena/setup.go @@ -17,9 +17,8 @@ limitations under the License. package athena import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/athena/workgroup" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/athena/workgroup/setup.go b/pkg/controller/athena/workgroup/setup.go index 1c1cff6465..934fbec44e 100644 --- a/pkg/controller/athena/workgroup/setup.go +++ b/pkg/controller/athena/workgroup/setup.go @@ -16,16 +16,15 @@ package workgroup import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/athena" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/athena/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -106,7 +105,6 @@ func preCreate(_ context.Context, cr *svcapitypes.WorkGroup, obj *svcsdk.CreateW // LateInitialize fills the empty fields in *svcapitypes.WorkGroupParameters with // the values seen in svcsdk.GetWorkGroupOutput. -// nolint:gocyclo func LateInitialize(cr *svcapitypes.WorkGroupParameters, obj *svcsdk.GetWorkGroupOutput) error { if cr.Configuration == nil && obj.WorkGroup.Configuration != nil { diff --git a/pkg/controller/autoscaling/autoscalinggroup/setup.go b/pkg/controller/autoscaling/autoscalinggroup/setup.go index 36320642f0..9e1a32a4c9 100644 --- a/pkg/controller/autoscaling/autoscalinggroup/setup.go +++ b/pkg/controller/autoscaling/autoscalinggroup/setup.go @@ -4,8 +4,6 @@ import ( "context" "sort" - "github.com/google/go-cmp/cmp" - svcsdk "github.com/aws/aws-sdk-go/service/autoscaling" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/autoscaling/v1beta1" @@ -67,7 +66,7 @@ func SetupAutoScalingGroup(mgr ctrl.Manager, o controller.Options) error { Complete(r) } -func isUpToDate(_ context.Context, obj *svcapitypes.AutoScalingGroup, obs *svcsdk.DescribeAutoScalingGroupsOutput) (bool, string, error) { // nolint:gocyclo +func isUpToDate(_ context.Context, obj *svcapitypes.AutoScalingGroup, obs *svcsdk.DescribeAutoScalingGroupsOutput) (bool, string, error) { //nolint:gocyclo in := obj.Spec.ForProvider asg := obs.AutoScalingGroups[0] diff --git a/pkg/controller/autoscaling/setup.go b/pkg/controller/autoscaling/setup.go index 8d0d168b37..eb09a4135c 100644 --- a/pkg/controller/autoscaling/setup.go +++ b/pkg/controller/autoscaling/setup.go @@ -17,9 +17,8 @@ limitations under the License. package autoscaling import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/autoscaling/autoscalinggroup" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/aws.go b/pkg/controller/aws.go index d9a53fa5b5..42e9740c8f 100644 --- a/pkg/controller/aws.go +++ b/pkg/controller/aws.go @@ -17,9 +17,8 @@ limitations under the License. package controller import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/acm" "github.com/crossplane-contrib/provider-aws/pkg/controller/acmpca" diff --git a/pkg/controller/batch/computeenvironment/setup.go b/pkg/controller/batch/computeenvironment/setup.go index fb6c34b0fe..0c4c3b2b60 100644 --- a/pkg/controller/batch/computeenvironment/setup.go +++ b/pkg/controller/batch/computeenvironment/setup.go @@ -19,16 +19,15 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/batch/batchiface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -115,7 +114,7 @@ func postObserve(_ context.Context, cr *svcapitypes.ComputeEnvironment, resp *sv return obs, nil } -// nolint:gocyclo +//nolint:gocyclo func preUpdate(_ context.Context, cr *svcapitypes.ComputeEnvironment, obj *svcsdk.UpdateComputeEnvironmentInput) error { obj.ComputeEnvironment = awsclients.String(meta.GetExternalName(cr)) obj.ServiceRole = cr.Spec.ForProvider.ServiceRoleARN diff --git a/pkg/controller/batch/job/controller.go b/pkg/controller/batch/job/controller.go index 9edb9b806e..a7c086f7a7 100644 --- a/pkg/controller/batch/job/controller.go +++ b/pkg/controller/batch/job/controller.go @@ -22,12 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/batch/batchiface" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -209,7 +208,7 @@ func (e *external) Delete(ctx context.Context, mg resource.Managed) error { return awsclient.Wrap(resource.Ignore(isErrorNotFound, err), errTerminateJob) } -func (e *external) lateInitialize(spec, current *svcapitypes.JobParameters) { // nolint:gocyclo +func (e *external) lateInitialize(spec, current *svcapitypes.JobParameters) { //nolint:gocyclo if spec.RetryStrategy == nil && current.RetryStrategy != nil { spec.RetryStrategy = current.RetryStrategy diff --git a/pkg/controller/batch/job/conversion.go b/pkg/controller/batch/job/conversion.go index 391a8ab88e..125cf7c14b 100644 --- a/pkg/controller/batch/job/conversion.go +++ b/pkg/controller/batch/job/conversion.go @@ -18,14 +18,13 @@ package job import ( svcsdk "github.com/aws/aws-sdk-go/service/batch" - "github.com/crossplane/crossplane-runtime/pkg/meta" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" ) -func generateJob(resp *svcsdk.DescribeJobsOutput) *svcapitypes.Job { // nolint:gocyclo +func generateJob(resp *svcsdk.DescribeJobsOutput) *svcapitypes.Job { //nolint:gocyclo cr := &svcapitypes.Job{} for _, elem := range resp.Jobs { @@ -242,7 +241,7 @@ func getContainerOverridesFromProperties(co *svcsdk.ContainerProperties) *svcapi return specco } -func generateSubmitJobInput(cr *svcapitypes.Job) *svcsdk.SubmitJobInput { // nolint:gocyclo +func generateSubmitJobInput(cr *svcapitypes.Job) *svcsdk.SubmitJobInput { //nolint:gocyclo res := &svcsdk.SubmitJobInput{} res.JobName = awsclient.String(cr.Name) diff --git a/pkg/controller/batch/jobdefinition/controller.go b/pkg/controller/batch/jobdefinition/controller.go index 16549b50e2..6569ce2384 100644 --- a/pkg/controller/batch/jobdefinition/controller.go +++ b/pkg/controller/batch/jobdefinition/controller.go @@ -22,12 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/batch/batchiface" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/batch/jobdefinition/conversion.go b/pkg/controller/batch/jobdefinition/conversion.go index 41481abbdd..a0e53f63b7 100644 --- a/pkg/controller/batch/jobdefinition/conversion.go +++ b/pkg/controller/batch/jobdefinition/conversion.go @@ -18,12 +18,13 @@ package jobdefinition import ( svcsdk "github.com/aws/aws-sdk-go/service/batch" + "k8s.io/utils/ptr" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" ) -func generateJobDefinition(resp *svcsdk.DescribeJobDefinitionsOutput) *svcapitypes.JobDefinition { // nolint:gocyclo +func generateJobDefinition(resp *svcsdk.DescribeJobDefinitionsOutput) *svcapitypes.JobDefinition { //nolint:gocyclo cr := &svcapitypes.JobDefinition{} for _, elem := range resp.JobDefinitions { @@ -112,7 +113,7 @@ func generateJobDefinition(resp *svcsdk.DescribeJobDefinitionsOutput) *svcapityp } // Helper for generateJobDefinition() with filling ContainerProperties -func getContainerProperties(cp *svcsdk.ContainerProperties) *svcapitypes.ContainerProperties { // nolint:gocyclo +func getContainerProperties(cp *svcsdk.ContainerProperties) *svcapitypes.ContainerProperties { //nolint:gocyclo speccp := &svcapitypes.ContainerProperties{} if cp != nil { if cp.Command != nil { @@ -286,7 +287,7 @@ func getContainerProperties(cp *svcsdk.ContainerProperties) *svcapitypes.Contain return speccp } -func generateRegisterJobDefinitionInput(cr *svcapitypes.JobDefinition) *svcsdk.RegisterJobDefinitionInput { // nolint:gocyclo +func generateRegisterJobDefinitionInput(cr *svcapitypes.JobDefinition) *svcsdk.RegisterJobDefinitionInput { //nolint:gocyclo res := &svcsdk.RegisterJobDefinitionInput{} res.JobDefinitionName = awsclient.String(cr.Name) res.Type = awsclient.String(cr.Spec.ForProvider.JobDefinitionType) @@ -361,7 +362,7 @@ func generateRegisterJobDefinitionInput(cr *svcapitypes.JobDefinition) *svcsdk.R } // Helper for generateRegisterJobDefinitionInput() with filling ContainerProperties -func assignContainerProperties(cp *svcapitypes.ContainerProperties) *svcsdk.ContainerProperties { // nolint:gocyclo +func assignContainerProperties(cp *svcapitypes.ContainerProperties) *svcsdk.ContainerProperties { //nolint:gocyclo sdkcp := &svcsdk.ContainerProperties{} if cp != nil { if cp.Command != nil { @@ -423,7 +424,7 @@ func assignContainerProperties(cp *svcapitypes.ContainerProperties) *svcsdk.Cont tmpfs = append(tmpfs, &svcsdk.Tmpfs{ ContainerPath: awsclient.String(tmpf.ContainerPath), MountOptions: tmpf.MountOptions, - Size: &tmpf.Size, + Size: ptr.To(tmpf.Size), }) } lipa.Tmpfs = tmpfs @@ -495,9 +496,9 @@ func assignContainerProperties(cp *svcapitypes.ContainerProperties) *svcsdk.Cont ulimits := []*svcsdk.Ulimit{} for _, ulimit := range cp.Ulimits { ulimits = append(ulimits, &svcsdk.Ulimit{ - HardLimit: &ulimit.HardLimit, + HardLimit: ptr.To(ulimit.HardLimit), Name: awsclient.String(ulimit.Name), - SoftLimit: &ulimit.SoftLimit, + SoftLimit: ptr.To(ulimit.SoftLimit), }) } sdkcp.Ulimits = ulimits diff --git a/pkg/controller/batch/jobqueue/setup.go b/pkg/controller/batch/jobqueue/setup.go index 4ac7cd8154..fc7c3e671d 100644 --- a/pkg/controller/batch/jobqueue/setup.go +++ b/pkg/controller/batch/jobqueue/setup.go @@ -20,16 +20,15 @@ import ( awsarn "github.com/aws/aws-sdk-go/aws/arn" svcsdk "github.com/aws/aws-sdk-go/service/batch" "github.com/aws/aws-sdk-go/service/batch/batchiface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/batch/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/batch/setup.go b/pkg/controller/batch/setup.go index 876afe33d3..f37142089d 100644 --- a/pkg/controller/batch/setup.go +++ b/pkg/controller/batch/setup.go @@ -17,9 +17,8 @@ limitations under the License. package batch import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/computeenvironment" "github.com/crossplane-contrib/provider-aws/pkg/controller/batch/job" diff --git a/pkg/controller/cache/cachesubnetgroup/controller.go b/pkg/controller/cache/cachesubnetgroup/controller.go index 4e95f0955d..a0e5db8c6d 100644 --- a/pkg/controller/cache/cachesubnetgroup/controller.go +++ b/pkg/controller/cache/cachesubnetgroup/controller.go @@ -21,10 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awscache "github.com/aws/aws-sdk-go-v2/service/elasticache" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +28,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" cachev1alpha1 "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cache/cachesubnetgroup/controller_test.go b/pkg/controller/cache/cachesubnetgroup/controller_test.go index 6f0e08ba57..8a900dd8a4 100644 --- a/pkg/controller/cache/cachesubnetgroup/controller_test.go +++ b/pkg/controller/cache/cachesubnetgroup/controller_test.go @@ -22,12 +22,11 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awscache "github.com/aws/aws-sdk-go-v2/service/elasticache" awscachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/cache/cluster/controller.go b/pkg/controller/cache/cluster/controller.go index 50c62fb338..3b3f06dfdf 100644 --- a/pkg/controller/cache/cluster/controller.go +++ b/pkg/controller/cache/cluster/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" elasticacheservice "github.com/aws/aws-sdk-go-v2/service/elasticache" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" cachev1alpha1 "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cache/cluster/controller_test.go b/pkg/controller/cache/cluster/controller_test.go index 4190b79d44..9b81c4acd2 100644 --- a/pkg/controller/cache/cluster/controller_test.go +++ b/pkg/controller/cache/cluster/controller_test.go @@ -23,13 +23,12 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awscache "github.com/aws/aws-sdk-go-v2/service/elasticache" awscachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/cache/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/cache/replicationgroup/managed.go b/pkg/controller/cache/replicationgroup/managed.go index b9ef91f11f..0c17e4b528 100644 --- a/pkg/controller/cache/replicationgroup/managed.go +++ b/pkg/controller/cache/replicationgroup/managed.go @@ -24,10 +24,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awselasticache "github.com/aws/aws-sdk-go-v2/service/elasticache" awselasticachetypes "github.com/aws/aws-sdk-go-v2/service/elasticache/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +32,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/password" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/cache/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -119,7 +118,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo cr, ok := mg.(*v1beta1.ReplicationGroup) if !ok { return managed.ExternalObservation{}, errors.New(errNotReplicationGroup) @@ -216,7 +215,7 @@ func (e *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext return managed.ExternalCreation{}, nil } -func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*v1beta1.ReplicationGroup) if !ok { return managed.ExternalUpdate{}, errors.New(errNotReplicationGroup) diff --git a/pkg/controller/cache/replicationgroup/managed_test.go b/pkg/controller/cache/replicationgroup/managed_test.go index e7309b332a..1683f89d9a 100644 --- a/pkg/controller/cache/replicationgroup/managed_test.go +++ b/pkg/controller/cache/replicationgroup/managed_test.go @@ -24,17 +24,16 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/elasticache" "github.com/aws/aws-sdk-go-v2/service/elasticache/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/cache/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/cache/setup.go b/pkg/controller/cache/setup.go index 1960762631..770657093b 100644 --- a/pkg/controller/cache/setup.go +++ b/pkg/controller/cache/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cache import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cachesubnetgroup" "github.com/crossplane-contrib/provider-aws/pkg/controller/cache/cluster" diff --git a/pkg/controller/cloudfront/distribution/setup.go b/pkg/controller/cloudfront/distribution/setup.go index 24317239a8..fe7c990102 100644 --- a/pkg/controller/cloudfront/distribution/setup.go +++ b/pkg/controller/cloudfront/distribution/setup.go @@ -20,10 +20,6 @@ package distribution import ( "context" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - svcsdk "github.com/aws/aws-sdk-go/service/cloudfront" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" @@ -32,6 +28,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudfront/v1alpha1" diff --git a/pkg/controller/cloudfront/responseheaderspolicy/setup.go b/pkg/controller/cloudfront/responseheaderspolicy/setup.go index 2924be78ce..b2864ebb64 100644 --- a/pkg/controller/cloudfront/responseheaderspolicy/setup.go +++ b/pkg/controller/cloudfront/responseheaderspolicy/setup.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/cloudfront" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudfront/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cloudfront/setup.go b/pkg/controller/cloudfront/setup.go index adee7d0398..4de848010a 100644 --- a/pkg/controller/cloudfront/setup.go +++ b/pkg/controller/cloudfront/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cloudfront import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cachepolicy" "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/cloudfrontoriginaccessidentity" diff --git a/pkg/controller/cloudfront/utils/lateinit.go b/pkg/controller/cloudfront/utils/lateinit.go index e7c9fc15db..a08d6450b5 100644 --- a/pkg/controller/cloudfront/utils/lateinit.go +++ b/pkg/controller/cloudfront/utils/lateinit.go @@ -173,7 +173,7 @@ func MapReplacer(m map[string]string) NameMapper { // Otherwise, an error will be returned. Returns `true` if at least one field has been stored // from source `responseObject` into a corresponding field of target `crObject`. // -// nolint:gocyclo +//nolint:gocyclo func LateInitializeFromResponse(parentName string, crObject interface{}, responseObject interface{}, opts ...LateInitOption) (bool, error) { if crObject == nil || reflect.ValueOf(crObject).IsNil() || @@ -222,7 +222,7 @@ func LateInitializeFromResponse(parentName string, crObject interface{}, respons var crFieldInitialized, crKeepField bool var err error - switch crStructField.Type.Kind() { // nolint:exhaustive + switch crStructField.Type.Kind() { //nolint:exhaustive // handle pointer struct field case reflect.Ptr: crFieldInitialized = allocate(crFieldValue, func(store, allocTypeValue reflect.Value) { @@ -270,7 +270,7 @@ func allocate(crFieldValue reflect.Value, alloc allocator) bool { return false } -// nolint:gocyclo +//nolint:gocyclo func handlePtr(cName string, crFieldInitialized bool, crFieldValue, responseFieldValue reflect.Value, responseStructField *reflect.StructField, opts ...LateInitOption) (bool, error) { crKeepField := false @@ -319,7 +319,7 @@ func handlePtr(cName string, crFieldInitialized bool, crFieldValue, responseFiel // elements from the desired slice (since they'd be late-init-ed right back in // during Observe, resetting the desired state). -// nolint:gocyclo +//nolint:gocyclo func handleSlice(cName string, crFieldInitialized bool, crFieldValue, responseFieldValue reflect.Value, responseStructField *reflect.StructField, opts ...LateInitOption) (bool, error) { crKeepField := false @@ -354,7 +354,7 @@ func handleSlice(cName string, crFieldInitialized bool, crFieldValue, responseFi // error from processing the next element of the slice var err error // check slice item's kind (not slice type) - switch item.Elem().Kind() { // nolint:exhaustive + switch item.Elem().Kind() { //nolint:exhaustive // if dealing with a slice of pointers case reflect.Ptr: _, err = handlePtr(cName, crFieldInitialized, item.Elem(), responseFieldValue.Index(i), nil, diff --git a/pkg/controller/cloudfront/utils/lateinit_test.go b/pkg/controller/cloudfront/utils/lateinit_test.go index 44e6d293c8..2c5aec5a51 100644 --- a/pkg/controller/cloudfront/utils/lateinit_test.go +++ b/pkg/controller/cloudfront/utils/lateinit_test.go @@ -30,15 +30,15 @@ const ( nameUnspecified = "unspecified" nameMapperTest = "mapper_test" suffixID = "ID" - suffixId = "Id" // nolint:golint + suffixId = "Id" //nolint:golint nameWith = "nameWith" nameWithID = nameWith + suffixID - nameWithId = nameWith + suffixId // nolint:golint + nameWithId = nameWith + suffixId //nolint:golint prefixHTTP = "HTTP" - prefixHttp = "Http" // nolint:golint + prefixHttp = "Http" //nolint:golint nameVersion = "Version" nameHTTPVersion = prefixHTTP + nameVersion - nameHttpVersion = prefixHttp + nameVersion // nolint:golint + nameHttpVersion = prefixHttp + nameVersion //nolint:golint ) var ( @@ -683,7 +683,7 @@ func TestIsUpToDate(t *testing.T) { actual: &struct { // linter disabled because we are testing a case based on // a common naming convention in aws-sdk-go - Id *string // nolint:golint + Id *string //nolint:golint }{ Id: &valTest, }, diff --git a/pkg/controller/cloudsearch/domain/setup.go b/pkg/controller/cloudsearch/domain/setup.go index 84c060ba88..625ef21482 100644 --- a/pkg/controller/cloudsearch/domain/setup.go +++ b/pkg/controller/cloudsearch/domain/setup.go @@ -21,15 +21,14 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/cloudsearch" "github.com/aws/aws-sdk-go/service/cloudsearch/cloudsearchiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudsearch/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cloudsearch/domain/setup_test.go b/pkg/controller/cloudsearch/domain/setup_test.go index abb2dc1d20..9ac6edf7c9 100644 --- a/pkg/controller/cloudsearch/domain/setup_test.go +++ b/pkg/controller/cloudsearch/domain/setup_test.go @@ -20,6 +20,8 @@ import ( "context" "testing" + "github.com/aws/aws-sdk-go/aws/request" + "github.com/aws/aws-sdk-go/service/cloudsearch" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" test "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" @@ -28,9 +30,6 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudsearch/v1alpha1" aws "github.com/crossplane-contrib/provider-aws/pkg/clients" fake "github.com/crossplane-contrib/provider-aws/pkg/clients/cloudsearch/fake" - - "github.com/aws/aws-sdk-go/aws/request" - "github.com/aws/aws-sdk-go/service/cloudsearch" ) var _ managed.ExternalClient = &external{} diff --git a/pkg/controller/cloudsearch/setup.go b/pkg/controller/cloudsearch/setup.go index c560d25c42..f8c375d2af 100644 --- a/pkg/controller/cloudsearch/setup.go +++ b/pkg/controller/cloudsearch/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cloudsearch import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudsearch/domain" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/cloudwatchlogs/loggroup/setup.go b/pkg/controller/cloudwatchlogs/loggroup/setup.go index 33ca6a12d0..6b36b97339 100644 --- a/pkg/controller/cloudwatchlogs/loggroup/setup.go +++ b/pkg/controller/cloudwatchlogs/loggroup/setup.go @@ -17,9 +17,6 @@ import ( "context" "strings" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cloudwatchlogs" svcsdkapi "github.com/aws/aws-sdk-go/service/cloudwatchlogs/cloudwatchlogsiface" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" @@ -29,6 +26,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cloudwatchlogs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -148,7 +147,7 @@ func (u *updater) isUpToDate(_ context.Context, cr *svcapitypes.LogGroup, obj *s return len(add) == 0 && len(remove) == 0, "", nil } -func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*svcapitypes.LogGroup) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/cloudwatchlogs/setup.go b/pkg/controller/cloudwatchlogs/setup.go index 0f56f9d6ef..6591a0285a 100644 --- a/pkg/controller/cloudwatchlogs/setup.go +++ b/pkg/controller/cloudwatchlogs/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cloudwatchlogs import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudwatchlogs/loggroup" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/cognitoidentity/identitypool/setup.go b/pkg/controller/cognitoidentity/identitypool/setup.go index d538f52be6..617732279b 100644 --- a/pkg/controller/cognitoidentity/identitypool/setup.go +++ b/pkg/controller/cognitoidentity/identitypool/setup.go @@ -17,16 +17,15 @@ import ( "context" "reflect" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentity" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentity/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentity/setup.go b/pkg/controller/cognitoidentity/setup.go index 2a232782a6..7f45bee1d5 100644 --- a/pkg/controller/cognitoidentity/setup.go +++ b/pkg/controller/cognitoidentity/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cognitoidentity import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentity/identitypool" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/cognitoidentityprovider/group/setup.go b/pkg/controller/cognitoidentityprovider/group/setup.go index 41fba9fb23..87ba4d77e4 100644 --- a/pkg/controller/cognitoidentityprovider/group/setup.go +++ b/pkg/controller/cognitoidentityprovider/group/setup.go @@ -16,16 +16,15 @@ package group import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go b/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go index d6d9476f0f..45bdf0e4a6 100644 --- a/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go +++ b/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go @@ -23,10 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awscognitoidp "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" awscognitoidptypes "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +30,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/manualv1alpha1" awsv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/groupusermembership/controller_test.go b/pkg/controller/cognitoidentityprovider/groupusermembership/controller_test.go index 46e6b6dea7..fe27bda1fc 100644 --- a/pkg/controller/cognitoidentityprovider/groupusermembership/controller_test.go +++ b/pkg/controller/cognitoidentityprovider/groupusermembership/controller_test.go @@ -22,19 +22,17 @@ import ( "strings" "testing" - "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/manualv1alpha1" - awscognitoidentityprovider "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider" awscognitoidentityprovidertypes "github.com/aws/aws-sdk-go-v2/service/cognitoidentityprovider/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/cognitoidentityprovider" "github.com/crossplane-contrib/provider-aws/pkg/clients/cognitoidentityprovider/fake" diff --git a/pkg/controller/cognitoidentityprovider/identityprovider/setup.go b/pkg/controller/cognitoidentityprovider/identityprovider/setup.go index 8620104dc0..68956dea33 100644 --- a/pkg/controller/cognitoidentityprovider/identityprovider/setup.go +++ b/pkg/controller/cognitoidentityprovider/identityprovider/setup.go @@ -17,18 +17,17 @@ import ( "context" "reflect" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" svcsdkapi "github.com/aws/aws-sdk-go/service/cognitoidentityprovider/cognitoidentityprovideriface" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/resourceserver/setup.go b/pkg/controller/cognitoidentityprovider/resourceserver/setup.go index f44f353759..62c3b24980 100644 --- a/pkg/controller/cognitoidentityprovider/resourceserver/setup.go +++ b/pkg/controller/cognitoidentityprovider/resourceserver/setup.go @@ -3,16 +3,15 @@ package resourceserver import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/setup.go b/pkg/controller/cognitoidentityprovider/setup.go index 99d8dab458..cfecf95994 100644 --- a/pkg/controller/cognitoidentityprovider/setup.go +++ b/pkg/controller/cognitoidentityprovider/setup.go @@ -17,9 +17,8 @@ limitations under the License. package cognitoidentityprovider import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/group" "github.com/crossplane-contrib/provider-aws/pkg/controller/cognitoidentityprovider/groupusermembership" diff --git a/pkg/controller/cognitoidentityprovider/userpool/setup.go b/pkg/controller/cognitoidentityprovider/userpool/setup.go index aa3e58cc5d..98561b65c9 100644 --- a/pkg/controller/cognitoidentityprovider/userpool/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpool/setup.go @@ -17,18 +17,17 @@ import ( "context" "reflect" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" svcsdkapi "github.com/aws/aws-sdk-go/service/cognitoidentityprovider/cognitoidentityprovideriface" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go b/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go index e4c8c30708..ce6019b8a0 100644 --- a/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go @@ -17,16 +17,15 @@ import ( "context" "reflect" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go b/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go index 9a4384f33e..d9dd773763 100644 --- a/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go @@ -16,16 +16,15 @@ package userpooldomain import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/cognitoidentityprovider" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/cognitoidentityprovider/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/config/config.go b/pkg/controller/config/config.go index 486632fa45..4deed169b0 100644 --- a/pkg/controller/config/config.go +++ b/pkg/controller/config/config.go @@ -17,12 +17,11 @@ limitations under the License. package config import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/providerconfig" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/apis/v1beta1" ) diff --git a/pkg/controller/database/dbsubnetgroup/controller.go b/pkg/controller/database/dbsubnetgroup/controller.go index e16084d340..848df8e306 100644 --- a/pkg/controller/database/dbsubnetgroup/controller.go +++ b/pkg/controller/database/dbsubnetgroup/controller.go @@ -18,17 +18,12 @@ package dbsubnetgroup import ( "context" - "reflect" "strings" "github.com/aws/aws-sdk-go-v2/aws" awsrds "github.com/aws/aws-sdk-go-v2/service/rds" awsrdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +31,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -113,7 +111,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.DBSubnetGroup) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/database/dbsubnetgroup/controller_test.go b/pkg/controller/database/dbsubnetgroup/controller_test.go index 4fed19c316..c3b818a521 100644 --- a/pkg/controller/database/dbsubnetgroup/controller_test.go +++ b/pkg/controller/database/dbsubnetgroup/controller_test.go @@ -23,13 +23,12 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsrds "github.com/aws/aws-sdk-go-v2/service/rds" awsrdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" v1beta1 "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/database/rdsinstance/rdsinstance.go b/pkg/controller/database/rdsinstance/rdsinstance.go index af27ed5fb2..fb4d9950ea 100644 --- a/pkg/controller/database/rdsinstance/rdsinstance.go +++ b/pkg/controller/database/rdsinstance/rdsinstance.go @@ -24,10 +24,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsrds "github.com/aws/aws-sdk-go-v2/service/rds" awsrdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +32,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/password" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -119,7 +118,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { cr, ok := mg.(*v1beta1.RDSInstance) if !ok { return managed.ExternalObservation{}, errors.New(errNotRDSInstance) @@ -199,7 +198,7 @@ func (e *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext return managed.ExternalCreation{ConnectionDetails: conn}, nil } -func (e *external) RestoreOrCreate(ctx context.Context, cr *v1beta1.RDSInstance, pw string) error { // nolint:gocyclo +func (e *external) RestoreOrCreate(ctx context.Context, cr *v1beta1.RDSInstance, pw string) error { //nolint:gocyclo if cr.Spec.ForProvider.RestoreFrom == nil { _, err := e.client.CreateDBInstance(ctx, rds.GenerateCreateRDSInstanceInput(meta.GetExternalName(cr), pw, &cr.Spec.ForProvider)) if err != nil { @@ -233,7 +232,7 @@ func (e *external) RestoreOrCreate(ctx context.Context, cr *v1beta1.RDSInstance, return nil } -func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*v1beta1.RDSInstance) if !ok { return managed.ExternalUpdate{}, errors.New(errNotRDSInstance) diff --git a/pkg/controller/database/rdsinstance/rdsinstance_test.go b/pkg/controller/database/rdsinstance/rdsinstance_test.go index 079a5e4767..62d491f0c0 100644 --- a/pkg/controller/database/rdsinstance/rdsinstance_test.go +++ b/pkg/controller/database/rdsinstance/rdsinstance_test.go @@ -20,25 +20,21 @@ import ( "testing" "time" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/google/go-cmp/cmp/cmpopts" - "k8s.io/apimachinery/pkg/types" - - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/aws/aws-sdk-go-v2/aws" awsrds "github.com/aws/aws-sdk-go-v2/service/rds" awsrdstypes "github.com/aws/aws-sdk-go-v2/service/rds/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/database/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" rds "github.com/crossplane-contrib/provider-aws/pkg/clients/database" diff --git a/pkg/controller/database/setup.go b/pkg/controller/database/setup.go index 502e2c9a5a..945c2f91e1 100644 --- a/pkg/controller/database/setup.go +++ b/pkg/controller/database/setup.go @@ -17,9 +17,8 @@ limitations under the License. package database import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/database/dbsubnetgroup" "github.com/crossplane-contrib/provider-aws/pkg/controller/database/rdsinstance" diff --git a/pkg/controller/dax/cluster/setup.go b/pkg/controller/dax/cluster/setup.go index 3e75b47214..389fd3c5b0 100644 --- a/pkg/controller/dax/cluster/setup.go +++ b/pkg/controller/dax/cluster/setup.go @@ -4,15 +4,14 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/dax" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/google/go-cmp/cmp" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/dax/cluster/setup_test.go b/pkg/controller/dax/cluster/setup_test.go index c2fe000fba..af5bede4cf 100644 --- a/pkg/controller/dax/cluster/setup_test.go +++ b/pkg/controller/dax/cluster/setup_test.go @@ -22,19 +22,18 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/dax" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/dax/fake" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -856,7 +855,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -1023,7 +1022,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -1157,7 +1156,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -1246,7 +1245,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/dax/parametergroup/setup.go b/pkg/controller/dax/parametergroup/setup.go index 4164362b69..f7989c05b9 100644 --- a/pkg/controller/dax/parametergroup/setup.go +++ b/pkg/controller/dax/parametergroup/setup.go @@ -3,8 +3,6 @@ package parametergroup import ( "context" - "sigs.k8s.io/controller-runtime/pkg/client" - svcsdk "github.com/aws/aws-sdk-go/service/dax" svcsdkapi "github.com/aws/aws-sdk-go/service/dax/daxiface" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" @@ -15,6 +13,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/dax/parametergroup/setup_test.go b/pkg/controller/dax/parametergroup/setup_test.go index dba209df64..cc23e8de0a 100644 --- a/pkg/controller/dax/parametergroup/setup_test.go +++ b/pkg/controller/dax/parametergroup/setup_test.go @@ -22,17 +22,15 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/dax" - + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/dax/fake" @@ -341,7 +339,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -511,7 +509,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -686,7 +684,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -775,7 +773,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/dax/setup.go b/pkg/controller/dax/setup.go index b5bc234ec8..87012d8e77 100644 --- a/pkg/controller/dax/setup.go +++ b/pkg/controller/dax/setup.go @@ -17,9 +17,8 @@ limitations under the License. package dax import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/cluster" "github.com/crossplane-contrib/provider-aws/pkg/controller/dax/parametergroup" diff --git a/pkg/controller/dax/subnetgroup/setup_test.go b/pkg/controller/dax/subnetgroup/setup_test.go index b5542b7048..7dee000417 100644 --- a/pkg/controller/dax/subnetgroup/setup_test.go +++ b/pkg/controller/dax/subnetgroup/setup_test.go @@ -22,19 +22,18 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/dax" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/dax/fake" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" ) const ( @@ -326,7 +325,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -482,7 +481,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -673,7 +672,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -762,7 +761,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called); diff != "" { + if diff := cmp.Diff(tc.want.dax, tc.args.dax.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/docdb/dbcluster/setup.go b/pkg/controller/docdb/dbcluster/setup.go index 1d2de0b0cd..1a8890c9c6 100644 --- a/pkg/controller/docdb/dbcluster/setup.go +++ b/pkg/controller/docdb/dbcluster/setup.go @@ -20,17 +20,9 @@ import ( "context" "strconv" - corev1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/docdb/docdbiface" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -39,6 +31,12 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/password" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -142,7 +140,7 @@ func (e *hooks) postObserve(ctx context.Context, cr *svcapitypes.DBCluster, resp return obs, nil } -func lateInitialize(cr *svcapitypes.DBClusterParameters, resp *svcsdk.DescribeDBClustersOutput) error { // nolint:gocyclo +func lateInitialize(cr *svcapitypes.DBClusterParameters, resp *svcsdk.DescribeDBClustersOutput) error { cluster := resp.DBClusters[0] if cr.AvailabilityZones == nil { @@ -173,7 +171,7 @@ func lateInitialize(cr *svcapitypes.DBClusterParameters, resp *svcsdk.DescribeDB return nil } -func (e *hooks) isUpToDate(ctx context.Context, cr *svcapitypes.DBCluster, resp *svcsdk.DescribeDBClustersOutput) (bool, string, error) { // nolint:gocyclo +func (e *hooks) isUpToDate(ctx context.Context, cr *svcapitypes.DBCluster, resp *svcsdk.DescribeDBClustersOutput) (bool, string, error) { if meta.WasDeleted(cr) { return true, "", nil // There is no need to check for updates when we want to delete. } @@ -287,7 +285,7 @@ func (e *hooks) postCreate(ctx context.Context, cr *svcapitypes.DBCluster, resp return cre, nil } -func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromSnapshotInput { // nolint:gocyclo +func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromSnapshotInput { //nolint:gocyclo res := &svcsdk.RestoreDBClusterFromSnapshotInput{} if cr.Spec.ForProvider.AvailabilityZones != nil { @@ -338,7 +336,7 @@ func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsd return res } -func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterToPointInTimeInput { // nolint:gocyclo +func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterToPointInTimeInput { p := cr.Spec.ForProvider res := &svcsdk.RestoreDBClusterToPointInTimeInput{ DBSubnetGroupName: p.DBSubnetGroupName, diff --git a/pkg/controller/docdb/dbcluster/setup_test.go b/pkg/controller/docdb/dbcluster/setup_test.go index 4a142e9032..8ae136487e 100644 --- a/pkg/controller/docdb/dbcluster/setup_test.go +++ b/pkg/controller/docdb/dbcluster/setup_test.go @@ -22,20 +22,19 @@ import ( "testing" "time" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - v1 "k8s.io/api/core/v1" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/ptr" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/docdb" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + v1 "k8s.io/api/core/v1" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -1865,7 +1864,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -2590,7 +2589,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -2689,7 +2688,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -3089,7 +3088,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/docdb/dbclusterparametergroup/setup.go b/pkg/controller/docdb/dbclusterparametergroup/setup.go index 48aaae8a0b..be83bd9a29 100644 --- a/pkg/controller/docdb/dbclusterparametergroup/setup.go +++ b/pkg/controller/docdb/dbclusterparametergroup/setup.go @@ -21,11 +21,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/docdb/docdbiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +28,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -221,7 +220,7 @@ func filterList(cr *svcapitypes.DBClusterParameterGroup, list *svcsdk.DescribeDB } } -func areParametersEqual(spec []*svcapitypes.CustomParameter, current []*svcsdk.Parameter) bool { // nolint:gocyclo +func areParametersEqual(spec []*svcapitypes.CustomParameter, current []*svcsdk.Parameter) bool { currentMap := make(map[string]*svcsdk.Parameter, len(current)) for _, currentParam := range current { currentMap[awsclient.StringValue(currentParam.ParameterName)] = currentParam diff --git a/pkg/controller/docdb/dbclusterparametergroup/setup_test.go b/pkg/controller/docdb/dbclusterparametergroup/setup_test.go index 8e02a68215..c426502921 100644 --- a/pkg/controller/docdb/dbclusterparametergroup/setup_test.go +++ b/pkg/controller/docdb/dbclusterparametergroup/setup_test.go @@ -20,17 +20,16 @@ import ( "context" "testing" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/docdb" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -689,7 +688,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -889,7 +888,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -978,7 +977,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -1139,7 +1138,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/docdb/dbinstance/setup.go b/pkg/controller/docdb/dbinstance/setup.go index 7444075f6b..861f0282dc 100644 --- a/pkg/controller/docdb/dbinstance/setup.go +++ b/pkg/controller/docdb/dbinstance/setup.go @@ -22,10 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/docdb/docdbiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -126,7 +125,7 @@ func postObserve(_ context.Context, cr *svcapitypes.DBInstance, resp *svcsdk.Des return obs, nil } -func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.DBInstance, resp *svcsdk.DescribeDBInstancesOutput) (bool, string, error) { // nolint:gocyclo +func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.DBInstance, resp *svcsdk.DescribeDBInstancesOutput) (bool, string, error) { instance := resp.DBInstances[0] switch { diff --git a/pkg/controller/docdb/dbinstance/setup_test.go b/pkg/controller/docdb/dbinstance/setup_test.go index 0b2b3407af..fd883011a1 100644 --- a/pkg/controller/docdb/dbinstance/setup_test.go +++ b/pkg/controller/docdb/dbinstance/setup_test.go @@ -21,18 +21,17 @@ import ( "strconv" "testing" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/docdb" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -2324,7 +2323,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -2460,7 +2459,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -2557,7 +2556,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -3020,7 +3019,7 @@ func TestUpdate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/docdb/dbsubnetgroup/setup.go b/pkg/controller/docdb/dbsubnetgroup/setup.go index 134a75f8df..483f1edf4b 100644 --- a/pkg/controller/docdb/dbsubnetgroup/setup.go +++ b/pkg/controller/docdb/dbsubnetgroup/setup.go @@ -21,10 +21,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/docdb" "github.com/aws/aws-sdk-go/service/docdb/docdbiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +28,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/docdb/dbsubnetgroup/setup_test.go b/pkg/controller/docdb/dbsubnetgroup/setup_test.go index ebe0127292..5c52d8471d 100644 --- a/pkg/controller/docdb/dbsubnetgroup/setup_test.go +++ b/pkg/controller/docdb/dbsubnetgroup/setup_test.go @@ -20,17 +20,16 @@ import ( "context" "testing" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/docdb" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/docdb/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -398,7 +397,7 @@ func TestObserve(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -501,7 +500,7 @@ func TestCreate(t *testing.T) { if diff := cmp.Diff(tc.want.result, o); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -594,7 +593,7 @@ func TestDelete(t *testing.T) { if diff := cmp.Diff(tc.want.cr, tc.args.cr, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) @@ -758,7 +757,7 @@ func TestModify(t *testing.T) { if diff := cmp.Diff(tc.want.result, res, test.EquateConditions()); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } - if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called); diff != "" { + if diff := cmp.Diff(tc.want.docdb, tc.args.docdb.Called, cmpopts.IgnoreInterfaces(struct{ context.Context }{})); diff != "" { t.Errorf("r: -want, +got:\n%s", diff) } }) diff --git a/pkg/controller/docdb/setup.go b/pkg/controller/docdb/setup.go index 568d23f555..8c43fe359b 100644 --- a/pkg/controller/docdb/setup.go +++ b/pkg/controller/docdb/setup.go @@ -17,9 +17,8 @@ limitations under the License. package docdb import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbcluster" "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/dbclusterparametergroup" diff --git a/pkg/controller/dynamodb/backup/hooks.go b/pkg/controller/dynamodb/backup/hooks.go index f076cfbc66..3aabb13b64 100644 --- a/pkg/controller/dynamodb/backup/hooks.go +++ b/pkg/controller/dynamodb/backup/hooks.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/dynamodb" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dynamodb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/dynamodb/globaltable/hooks.go b/pkg/controller/dynamodb/globaltable/hooks.go index bdb7b921d5..2b2d109f03 100644 --- a/pkg/controller/dynamodb/globaltable/hooks.go +++ b/pkg/controller/dynamodb/globaltable/hooks.go @@ -22,10 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/dynamodb" svcsdkapi "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dynamodb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/dynamodb/setup.go b/pkg/controller/dynamodb/setup.go index 6c52608b86..551c955b3a 100644 --- a/pkg/controller/dynamodb/setup.go +++ b/pkg/controller/dynamodb/setup.go @@ -17,9 +17,8 @@ limitations under the License. package dynamodb import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/backup" "github.com/crossplane-contrib/provider-aws/pkg/controller/dynamodb/globaltable" diff --git a/pkg/controller/dynamodb/table/hooks.go b/pkg/controller/dynamodb/table/hooks.go index 3b3f013ff7..9f337a0ec3 100644 --- a/pkg/controller/dynamodb/table/hooks.go +++ b/pkg/controller/dynamodb/table/hooks.go @@ -24,12 +24,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/dynamodb" svcsdkapi "github.com/aws/aws-sdk-go/service/dynamodb/dynamodbiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "k8s.io/utils/ptr" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -37,6 +31,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "k8s.io/utils/ptr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dynamodb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -207,7 +206,7 @@ func (e *tagger) Initialize(ctx context.Context, mg resource.Managed) error { return errors.Wrap(e.kube.Update(ctx, cr), "cannot update Table Spec") } -func lateInitialize(in *svcapitypes.TableParameters, t *svcsdk.DescribeTableOutput) error { // nolint:gocyclo,unparam +func lateInitialize(in *svcapitypes.TableParameters, t *svcsdk.DescribeTableOutput) error { //nolint:gocyclo if t == nil { return nil } @@ -598,7 +597,7 @@ func diffGlobalSecondaryIndexes(spec []*svcsdk.GlobalSecondaryIndexDescription, } // GenerateGlobalSecondaryIndexDescriptions generates an array of GlobalSecondaryIndexDescriptions. -func GenerateGlobalSecondaryIndexDescriptions(p []*svcapitypes.GlobalSecondaryIndex) []*svcsdk.GlobalSecondaryIndexDescription { // nolint:gocyclo +func GenerateGlobalSecondaryIndexDescriptions(p []*svcapitypes.GlobalSecondaryIndex) []*svcsdk.GlobalSecondaryIndexDescription { //nolint:gocyclo // Linter is disabled because this is a copy-paste from generated code and // very simple. result := make([]*svcsdk.GlobalSecondaryIndexDescription, len(p)) diff --git a/pkg/controller/ec2/address/controller.go b/pkg/controller/ec2/address/controller.go index e66a14a42b..9e47ac67f6 100644 --- a/pkg/controller/ec2/address/controller.go +++ b/pkg/controller/ec2/address/controller.go @@ -24,11 +24,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +31,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -114,7 +113,7 @@ type external struct { client ec2.AddressClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.Address) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/address/controller_test.go b/pkg/controller/ec2/address/controller_test.go index acb21e337b..58d54da42a 100644 --- a/pkg/controller/ec2/address/controller_test.go +++ b/pkg/controller/ec2/address/controller_test.go @@ -20,20 +20,18 @@ import ( "context" "testing" + awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" + awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - - awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" - awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2" diff --git a/pkg/controller/ec2/flowlog/setup.go b/pkg/controller/ec2/flowlog/setup.go index c97c11e2c9..e97642b976 100644 --- a/pkg/controller/ec2/flowlog/setup.go +++ b/pkg/controller/ec2/flowlog/setup.go @@ -5,15 +5,7 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/ec2" "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - - svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" - "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" - aws "github.com/crossplane-contrib/provider-aws/pkg/clients" - awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - "github.com/crossplane-contrib/provider-aws/pkg/features" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/errors" @@ -21,10 +13,15 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" - cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" ctrl "sigs.k8s.io/controller-runtime" + + svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" + "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" + aws "github.com/crossplane-contrib/provider-aws/pkg/clients" + awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/features" ) var ( diff --git a/pkg/controller/ec2/instance/controller.go b/pkg/controller/ec2/instance/controller.go index deb074c656..a10cef07dd 100644 --- a/pkg/controller/ec2/instance/controller.go +++ b/pkg/controller/ec2/instance/controller.go @@ -23,11 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +30,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -114,7 +113,7 @@ type external struct { client ec2.InstanceClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo cr, ok := mgd.(*svcapitypes.Instance) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -265,7 +264,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{ExternalNameAssigned: true}, nil } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*svcapitypes.Instance) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/instance/controller_test.go b/pkg/controller/ec2/instance/controller_test.go index 8b3123e93d..68b974f47c 100644 --- a/pkg/controller/ec2/instance/controller_test.go +++ b/pkg/controller/ec2/instance/controller_test.go @@ -20,20 +20,18 @@ import ( "context" "testing" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - + "github.com/aws/aws-sdk-go-v2/aws" + awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" + types "github.com/aws/aws-sdk-go-v2/service/ec2/types" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" - - "github.com/aws/aws-sdk-go-v2/aws" - awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" - types "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/internetgateway/controller.go b/pkg/controller/ec2/internetgateway/controller.go index f92f9379ec..0e1a0069f6 100644 --- a/pkg/controller/ec2/internetgateway/controller.go +++ b/pkg/controller/ec2/internetgateway/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/internetgateway/controller_test.go b/pkg/controller/ec2/internetgateway/controller_test.go index de326eee0e..9160772e4e 100644 --- a/pkg/controller/ec2/internetgateway/controller_test.go +++ b/pkg/controller/ec2/internetgateway/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/launchtemplate/setup.go b/pkg/controller/ec2/launchtemplate/setup.go index 676571df78..73f65205b1 100644 --- a/pkg/controller/ec2/launchtemplate/setup.go +++ b/pkg/controller/ec2/launchtemplate/setup.go @@ -5,10 +5,6 @@ import ( "sort" svcsdk "github.com/aws/aws-sdk-go/service/ec2" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -16,6 +12,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/launchtemplateversion/setup.go b/pkg/controller/ec2/launchtemplateversion/setup.go index 368eef6bbf..32c93cdd91 100644 --- a/pkg/controller/ec2/launchtemplateversion/setup.go +++ b/pkg/controller/ec2/launchtemplateversion/setup.go @@ -5,8 +5,6 @@ import ( "strconv" svcsdk "github.com/aws/aws-sdk-go/service/ec2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/natgateway/controller.go b/pkg/controller/ec2/natgateway/controller.go index 4bc4732593..58c8b2436c 100644 --- a/pkg/controller/ec2/natgateway/controller.go +++ b/pkg/controller/ec2/natgateway/controller.go @@ -7,10 +7,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -18,6 +14,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/natgateway/controller_test.go b/pkg/controller/ec2/natgateway/controller_test.go index 412164a310..92ace880a6 100644 --- a/pkg/controller/ec2/natgateway/controller_test.go +++ b/pkg/controller/ec2/natgateway/controller_test.go @@ -9,15 +9,14 @@ import ( awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/route/setup.go b/pkg/controller/ec2/route/setup.go index 5631076ec5..6c5dcfc8c9 100644 --- a/pkg/controller/ec2/route/setup.go +++ b/pkg/controller/ec2/route/setup.go @@ -4,9 +4,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/ec2" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +11,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -90,7 +89,7 @@ func (e *external) observer(ctx context.Context, mg cpresource.Managed) (managed route, err := e.findRouteByDestination(ctx, cr) if err != nil { - return managed.ExternalObservation{ResourceExists: false}, nil // nolint:nilerr + return managed.ExternalObservation{ResourceExists: false}, nil //nolint:nilerr } if awsclients.StringValue(route.State) == svcsdk.RouteStateActive { diff --git a/pkg/controller/ec2/routetable/controller.go b/pkg/controller/ec2/routetable/controller.go index 34b5f17f58..2507d6c016 100644 --- a/pkg/controller/ec2/routetable/controller.go +++ b/pkg/controller/ec2/routetable/controller.go @@ -23,11 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +30,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -119,7 +118,7 @@ type external struct { client ec2.RouteTableClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.RouteTable) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -178,7 +177,7 @@ func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.E }, nil } -func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.ExternalCreation, error) { // nolint:gocyclo +func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.ExternalCreation, error) { cr, ok := mgd.(*v1beta1.RouteTable) if !ok { return managed.ExternalCreation{}, errors.New(errUnexpectedObject) @@ -196,7 +195,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, nil } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.RouteTable) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) @@ -285,7 +284,7 @@ func (e *external) Delete(ctx context.Context, mgd resource.Managed) error { return awsclient.Wrap(resource.Ignore(ec2.IsRouteTableNotFoundErr, err), errDelete) } -func (e *external) deleteRoutes(ctx context.Context, tableID string, desired []v1beta1.RouteBeta, observed []v1beta1.RouteState) error { // nolint:gocyclo +func (e *external) deleteRoutes(ctx context.Context, tableID string, desired []v1beta1.RouteBeta, observed []v1beta1.RouteState) error { //nolint:gocyclo for _, rt := range observed { found := false for _, ds := range desired { @@ -326,7 +325,7 @@ func (e *external) deleteRoutes(ctx context.Context, tableID string, desired []v return nil } -func (e *external) createRoutes(ctx context.Context, tableID string, desired []v1beta1.RouteBeta, observed []v1beta1.RouteState) error { // nolint:gocyclo +func (e *external) createRoutes(ctx context.Context, tableID string, desired []v1beta1.RouteBeta, observed []v1beta1.RouteState) error { //nolint:gocyclo for _, rt := range desired { isObserved := false for _, ob := range observed { diff --git a/pkg/controller/ec2/routetable/controller_test.go b/pkg/controller/ec2/routetable/controller_test.go index 5b9a6c2550..e94a61cdb5 100644 --- a/pkg/controller/ec2/routetable/controller_test.go +++ b/pkg/controller/ec2/routetable/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/securitygroup/controller.go b/pkg/controller/ec2/securitygroup/controller.go index 420decee98..5721f3f5cc 100644 --- a/pkg/controller/ec2/securitygroup/controller.go +++ b/pkg/controller/ec2/securitygroup/controller.go @@ -23,13 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "k8s.io/apimachinery/pkg/types" - "k8s.io/client-go/util/retry" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -37,6 +30,12 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -122,7 +121,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.SecurityGroup) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -220,7 +219,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, awsclient.Wrap(err, errRevokeEgress) } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.SecurityGroup) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/securitygroup/controller_test.go b/pkg/controller/ec2/securitygroup/controller_test.go index 9011e7255f..80e1ef0a45 100644 --- a/pkg/controller/ec2/securitygroup/controller_test.go +++ b/pkg/controller/ec2/securitygroup/controller_test.go @@ -20,20 +20,18 @@ import ( "context" "testing" - "github.com/aws/smithy-go/document" - "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - + "github.com/aws/smithy-go/document" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/securitygrouprule/controller.go b/pkg/controller/ec2/securitygrouprule/controller.go index 9f8f5413c7..e7a2e2cde5 100644 --- a/pkg/controller/ec2/securitygrouprule/controller.go +++ b/pkg/controller/ec2/securitygrouprule/controller.go @@ -7,13 +7,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - - "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" - "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" - awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" - "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2" - "github.com/crossplane-contrib/provider-aws/pkg/features" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -23,6 +16,12 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" + "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" + awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2" + "github.com/crossplane-contrib/provider-aws/pkg/features" ) const ( @@ -108,7 +107,7 @@ func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.E // If err is not nil, the sgr does not exist if err != nil { - return managed.ExternalObservation{ // nolint:nilerr + return managed.ExternalObservation{ //nolint:nilerr ResourceExists: false, }, nil } diff --git a/pkg/controller/ec2/securitygrouprule/controller_test.go b/pkg/controller/ec2/securitygrouprule/controller_test.go index fe12235604..3c0630273a 100644 --- a/pkg/controller/ec2/securitygrouprule/controller_test.go +++ b/pkg/controller/ec2/securitygrouprule/controller_test.go @@ -6,20 +6,17 @@ import ( "testing" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" - "github.com/aws/aws-sdk-go-v2/service/ec2/types" - - "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" - "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2" - "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2/fake" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "sigs.k8s.io/controller-runtime/pkg/client" + + "github.com/crossplane-contrib/provider-aws/apis/ec2/manualv1alpha1" + "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2" + "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2/fake" ) var ( diff --git a/pkg/controller/ec2/setup.go b/pkg/controller/ec2/setup.go index cca3b3fa68..2154e32b97 100644 --- a/pkg/controller/ec2/setup.go +++ b/pkg/controller/ec2/setup.go @@ -17,9 +17,8 @@ limitations under the License. package ec2 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/address" "github.com/crossplane-contrib/provider-aws/pkg/controller/ec2/flowlog" diff --git a/pkg/controller/ec2/subnet/controller.go b/pkg/controller/ec2/subnet/controller.go index 902d12fa3a..c5b982454c 100644 --- a/pkg/controller/ec2/subnet/controller.go +++ b/pkg/controller/ec2/subnet/controller.go @@ -24,11 +24,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +31,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -116,7 +115,7 @@ type external struct { client ec2.SubnetClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*v1beta1.Subnet) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -186,7 +185,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, nil } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.Subnet) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/subnet/controller_test.go b/pkg/controller/ec2/subnet/controller_test.go index 9db99696bb..8fdce5d2c9 100644 --- a/pkg/controller/ec2/subnet/controller_test.go +++ b/pkg/controller/ec2/subnet/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/transitgateway/setup.go b/pkg/controller/ec2/transitgateway/setup.go index 51e0873786..9621adb05a 100644 --- a/pkg/controller/ec2/transitgateway/setup.go +++ b/pkg/controller/ec2/transitgateway/setup.go @@ -6,10 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -17,6 +13,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -120,8 +119,7 @@ func postCreate(ctx context.Context, cr *svcapitypes.TransitGateway, obj *svcsdk // LateInitialize fills the empty fields in *svcapitypes.TransitGateway with // the values seen in svcsdk.DescribeTransitGatewaysOutput. -// nolint:gocyclo -func LateInitialize(cr *svcapitypes.TransitGatewayParameters, obj *svcsdk.DescribeTransitGatewaysOutput) error { // nolint:gocyclo +func LateInitialize(cr *svcapitypes.TransitGatewayParameters, obj *svcsdk.DescribeTransitGatewaysOutput) error { if len(obj.TransitGateways) > 0 { cr.Options = &svcapitypes.TransitGatewayRequestOptions{ AmazonSideASN: obj.TransitGateways[0].Options.AmazonSideAsn, diff --git a/pkg/controller/ec2/transitgatewayroute/setup.go b/pkg/controller/ec2/transitgatewayroute/setup.go index 61ef0ed210..bb69d9f783 100644 --- a/pkg/controller/ec2/transitgatewayroute/setup.go +++ b/pkg/controller/ec2/transitgatewayroute/setup.go @@ -6,10 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -17,6 +13,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -104,7 +103,7 @@ func (e *external) observer(ctx context.Context, mg cpresource.Managed) (managed transitGatewayRoute, err := e.findRouteByDestination(ctx, cr) if err != nil { - return managed.ExternalObservation{ResourceExists: false}, nil // nolint:nilerr + return managed.ExternalObservation{ResourceExists: false}, nil //nolint:nilerr } switch aws.StringValue(transitGatewayRoute.State) { diff --git a/pkg/controller/ec2/transitgatewayroutetable/setup.go b/pkg/controller/ec2/transitgatewayroutetable/setup.go index 7c404026ab..7da5812b13 100644 --- a/pkg/controller/ec2/transitgatewayroutetable/setup.go +++ b/pkg/controller/ec2/transitgatewayroutetable/setup.go @@ -7,10 +7,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -18,6 +14,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/transitgatewayvpcattachment/setup.go b/pkg/controller/ec2/transitgatewayvpcattachment/setup.go index 7e321d92ab..bdab1a1996 100644 --- a/pkg/controller/ec2/transitgatewayvpcattachment/setup.go +++ b/pkg/controller/ec2/transitgatewayvpcattachment/setup.go @@ -7,10 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -18,6 +14,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/volume/setup.go b/pkg/controller/ec2/volume/setup.go index c743786bf5..8f984e9067 100644 --- a/pkg/controller/ec2/volume/setup.go +++ b/pkg/controller/ec2/volume/setup.go @@ -17,8 +17,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/ec2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -26,6 +24,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/vpc/controller.go b/pkg/controller/ec2/vpc/controller.go index c33a5922e3..7af462da5c 100644 --- a/pkg/controller/ec2/vpc/controller.go +++ b/pkg/controller/ec2/vpc/controller.go @@ -24,11 +24,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +31,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -117,7 +116,7 @@ type external struct { client ec2.VPCClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.VPC) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -220,7 +219,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, nil } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.VPC) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/vpc/controller_test.go b/pkg/controller/ec2/vpc/controller_test.go index da115fdb6d..be55962249 100644 --- a/pkg/controller/ec2/vpc/controller_test.go +++ b/pkg/controller/ec2/vpc/controller_test.go @@ -20,20 +20,18 @@ import ( "context" "testing" - "github.com/crossplane/crossplane-runtime/pkg/resource" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/vpccidrblock/controller.go b/pkg/controller/ec2/vpccidrblock/controller.go index 73b6955175..69473c6b14 100644 --- a/pkg/controller/ec2/vpccidrblock/controller.go +++ b/pkg/controller/ec2/vpccidrblock/controller.go @@ -24,10 +24,6 @@ import ( awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" awsec2types "github.com/aws/aws-sdk-go-v2/service/ec2/types" awsgo "github.com/aws/aws-sdk-go/aws" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +31,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -110,7 +109,7 @@ type external struct { client ec2.VPCCIDRBlockClient } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.VPCCIDRBlock) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/ec2/vpccidrblock/controller_test.go b/pkg/controller/ec2/vpccidrblock/controller_test.go index 94d2dfab7c..e4c7ce1b89 100644 --- a/pkg/controller/ec2/vpccidrblock/controller_test.go +++ b/pkg/controller/ec2/vpccidrblock/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsec2 "github.com/aws/aws-sdk-go-v2/service/ec2" "github.com/aws/aws-sdk-go-v2/service/ec2/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ec2/vpcendpoint/setup.go b/pkg/controller/ec2/vpcendpoint/setup.go index aa8f062449..70e32ce518 100644 --- a/pkg/controller/ec2/vpcendpoint/setup.go +++ b/pkg/controller/ec2/vpcendpoint/setup.go @@ -8,11 +8,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - v1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -20,6 +15,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ec2/vpcendpoint/setup_test.go b/pkg/controller/ec2/vpcendpoint/setup_test.go index 6637306845..44b16feb6b 100644 --- a/pkg/controller/ec2/vpcendpoint/setup_test.go +++ b/pkg/controller/ec2/vpcendpoint/setup_test.go @@ -23,6 +23,7 @@ import ( "github.com/aws/aws-sdk-go/aws/request" "github.com/aws/aws-sdk-go/service/ec2" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" @@ -34,11 +35,8 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" - "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2/fake" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - aws "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/clients/ec2/fake" ) const ( diff --git a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go index d73575419f..e2f85bc0af 100644 --- a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go +++ b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go @@ -7,10 +7,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -18,6 +14,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -286,7 +285,7 @@ func DifferenceARN(local []*string, remote []*string) ([]*string, []*string) { } // GenerateObservation is used to produce v1alpha1.vpcendpointserviceconfigurationObservation -func GenerateObservation(obj *svcsdk.ServiceConfiguration) *svcapitypes.ServiceConfiguration { // nolint:gocyclo +func GenerateObservation(obj *svcsdk.ServiceConfiguration) *svcapitypes.ServiceConfiguration { if obj == nil { return &svcapitypes.ServiceConfiguration{} } diff --git a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup_test.go b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup_test.go index a2316c85b8..e58b74160f 100644 --- a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup_test.go +++ b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup_test.go @@ -27,7 +27,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" - aws "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/controller/ec2/vpcpeeringconnection/setup.go b/pkg/controller/ec2/vpcpeeringconnection/setup.go index 0cbc641ba9..2417d924db 100644 --- a/pkg/controller/ec2/vpcpeeringconnection/setup.go +++ b/pkg/controller/ec2/vpcpeeringconnection/setup.go @@ -9,10 +9,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ec2" svcsdkapi "github.com/aws/aws-sdk-go/service/ec2/ec2iface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -20,6 +16,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -92,7 +91,7 @@ func filterList(cr *svcapitypes.VPCPeeringConnection, obj *svcsdk.DescribeVpcPee return resp } -func (e *custom) postObserve(ctx context.Context, cr *svcapitypes.VPCPeeringConnection, obj *svcsdk.DescribeVpcPeeringConnectionsOutput, obs managed.ExternalObservation, err error) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *custom) postObserve(ctx context.Context, cr *svcapitypes.VPCPeeringConnection, obj *svcsdk.DescribeVpcPeeringConnectionsOutput, obs managed.ExternalObservation, err error) (managed.ExternalObservation, error) { //nolint:gocyclo if err != nil { return managed.ExternalObservation{}, err } diff --git a/pkg/controller/ec2/vpcpeeringconnection/setup_test.go b/pkg/controller/ec2/vpcpeeringconnection/setup_test.go index 24a7750dab..1048c0f9b0 100644 --- a/pkg/controller/ec2/vpcpeeringconnection/setup_test.go +++ b/pkg/controller/ec2/vpcpeeringconnection/setup_test.go @@ -27,7 +27,6 @@ import ( "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ec2/v1alpha1" - aws "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/controller/ecr/lifecyclepolicy/setup.go b/pkg/controller/ecr/lifecyclepolicy/setup.go index 7d409a50b5..7a3c914e14 100644 --- a/pkg/controller/ecr/lifecyclepolicy/setup.go +++ b/pkg/controller/ecr/lifecyclepolicy/setup.go @@ -5,15 +5,14 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/ecr" svcsdkapi "github.com/aws/aws-sdk-go/service/ecr/ecriface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecr/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/ecr/repository/controller.go b/pkg/controller/ecr/repository/controller.go index a72eb1047c..a1e99dce8b 100644 --- a/pkg/controller/ecr/repository/controller.go +++ b/pkg/controller/ecr/repository/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsecr "github.com/aws/aws-sdk-go-v2/service/ecr" awsecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ecr/repository/controller_test.go b/pkg/controller/ecr/repository/controller_test.go index b9f24165ec..1c07fb34fa 100644 --- a/pkg/controller/ecr/repository/controller_test.go +++ b/pkg/controller/ecr/repository/controller_test.go @@ -20,24 +20,21 @@ import ( "context" "testing" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" awsecr "github.com/aws/aws-sdk-go-v2/service/ecr" awsecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - + "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" ecr "github.com/crossplane-contrib/provider-aws/pkg/clients/ecr" "github.com/crossplane-contrib/provider-aws/pkg/clients/ecr/fake" diff --git a/pkg/controller/ecr/repositorypolicy/controller.go b/pkg/controller/ecr/repositorypolicy/controller.go index 23070a84b5..fb37c55bcc 100644 --- a/pkg/controller/ecr/repositorypolicy/controller.go +++ b/pkg/controller/ecr/repositorypolicy/controller.go @@ -20,17 +20,16 @@ import ( "context" awsecr "github.com/aws/aws-sdk-go-v2/service/ecr" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ecr/repositorypolicy/controller_test.go b/pkg/controller/ecr/repositorypolicy/controller_test.go index ef1903b23c..e6e7aafea3 100644 --- a/pkg/controller/ecr/repositorypolicy/controller_test.go +++ b/pkg/controller/ecr/repositorypolicy/controller_test.go @@ -20,20 +20,17 @@ import ( "context" "testing" - "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" - - awsecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types" - awsecr "github.com/aws/aws-sdk-go-v2/service/ecr" + awsecrtypes "github.com/aws/aws-sdk-go-v2/service/ecr/types" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - + "github.com/crossplane-contrib/provider-aws/apis/ecr/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/ecr" "github.com/crossplane-contrib/provider-aws/pkg/clients/ecr/fake" diff --git a/pkg/controller/ecr/setup.go b/pkg/controller/ecr/setup.go index 073a0d2b4d..3250bd3c8e 100644 --- a/pkg/controller/ecr/setup.go +++ b/pkg/controller/ecr/setup.go @@ -17,9 +17,8 @@ limitations under the License. package ecr import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/lifecyclepolicy" "github.com/crossplane-contrib/provider-aws/pkg/controller/ecr/repository" diff --git a/pkg/controller/ecs/cluster/setup.go b/pkg/controller/ecs/cluster/setup.go index 03595bcce7..26e0af0826 100644 --- a/pkg/controller/ecs/cluster/setup.go +++ b/pkg/controller/ecs/cluster/setup.go @@ -5,8 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ecs" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ecs/service/setup.go b/pkg/controller/ecs/service/setup.go index 62e10910a7..0bba5fe9c0 100644 --- a/pkg/controller/ecs/service/setup.go +++ b/pkg/controller/ecs/service/setup.go @@ -3,11 +3,8 @@ package service import ( "context" - ctrl "sigs.k8s.io/controller-runtime" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ecs" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -15,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ecs/service/setup_test.go b/pkg/controller/ecs/service/setup_test.go index 3f54941c53..bd3afe91b1 100644 --- a/pkg/controller/ecs/service/setup_test.go +++ b/pkg/controller/ecs/service/setup_test.go @@ -3,12 +3,10 @@ package service import ( "testing" - "github.com/google/go-cmp/cmp" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ecs" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/google/go-cmp/cmp" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" ) diff --git a/pkg/controller/ecs/setup.go b/pkg/controller/ecs/setup.go index 2045b1b11f..7b53469ecb 100644 --- a/pkg/controller/ecs/setup.go +++ b/pkg/controller/ecs/setup.go @@ -17,9 +17,8 @@ limitations under the License. package ecs import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/cluster" "github.com/crossplane-contrib/provider-aws/pkg/controller/ecs/service" diff --git a/pkg/controller/ecs/taskdefinition/setup.go b/pkg/controller/ecs/taskdefinition/setup.go index 167c7aca27..354cad1982 100644 --- a/pkg/controller/ecs/taskdefinition/setup.go +++ b/pkg/controller/ecs/taskdefinition/setup.go @@ -5,9 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ecs" - - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -15,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -121,7 +119,7 @@ func preDelete(_ context.Context, cr *svcapitypes.TaskDefinition, obj *svcsdk.De // Helper func to copy CustomVolume types into AWS SDK types // Mostly copied from the autogenerated conversion code before // ignoring the API in generator-config.yaml -func generateVolumes(cr *svcapitypes.TaskDefinition) []*svcsdk.Volume { // nolint:gocyclo +func generateVolumes(cr *svcapitypes.TaskDefinition) []*svcsdk.Volume { //nolint:gocyclo volumes := []*svcsdk.Volume{} if cr.Spec.ForProvider.Volumes == nil { diff --git a/pkg/controller/ecs/taskdefinition/setup_test.go b/pkg/controller/ecs/taskdefinition/setup_test.go index 6bdbabc3f0..3cdc8c7ff6 100644 --- a/pkg/controller/ecs/taskdefinition/setup_test.go +++ b/pkg/controller/ecs/taskdefinition/setup_test.go @@ -3,10 +3,9 @@ package taskdefinition import ( "testing" - "github.com/google/go-cmp/cmp" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/ecs" + "github.com/google/go-cmp/cmp" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" ) diff --git a/pkg/controller/efs/accesspoint/setup.go b/pkg/controller/efs/accesspoint/setup.go index 3cd7be2a5f..6fa3390188 100644 --- a/pkg/controller/efs/accesspoint/setup.go +++ b/pkg/controller/efs/accesspoint/setup.go @@ -2,20 +2,18 @@ package accesspoint import ( svcsdk "github.com/aws/aws-sdk-go/service/efs" - "golang.org/x/net/context" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "golang.org/x/net/context" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/efs/v1alpha1" - "github.com/crossplane-contrib/provider-aws/pkg/features" - awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/features" ) // SetupAccessPoint adds a controller that reconciles AccessPoint. diff --git a/pkg/controller/efs/filesystem/setup.go b/pkg/controller/efs/filesystem/setup.go index d7b813478e..df76de8637 100644 --- a/pkg/controller/efs/filesystem/setup.go +++ b/pkg/controller/efs/filesystem/setup.go @@ -5,8 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/efs" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/efs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/efs/mounttarget/setup.go b/pkg/controller/efs/mounttarget/setup.go index 4c617637cd..875a951b4a 100644 --- a/pkg/controller/efs/mounttarget/setup.go +++ b/pkg/controller/efs/mounttarget/setup.go @@ -4,8 +4,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/efs" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -13,6 +11,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/efs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/efs/setup.go b/pkg/controller/efs/setup.go index 9e14449c2f..27308e1ca6 100644 --- a/pkg/controller/efs/setup.go +++ b/pkg/controller/efs/setup.go @@ -17,9 +17,8 @@ limitations under the License. package efs import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/accesspoint" "github.com/crossplane-contrib/provider-aws/pkg/controller/efs/filesystem" diff --git a/pkg/controller/eks/addon/setup.go b/pkg/controller/eks/addon/setup.go index b061871ebf..6e4ce630de 100644 --- a/pkg/controller/eks/addon/setup.go +++ b/pkg/controller/eks/addon/setup.go @@ -22,12 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" awseks "github.com/aws/aws-sdk-go/service/eks" "github.com/aws/aws-sdk-go/service/eks/eksiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "sigs.k8s.io/yaml" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" + "sigs.k8s.io/yaml" eksv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/eks/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/eks/addon/setup_test.go b/pkg/controller/eks/addon/setup_test.go index 3659468554..41ce800ec3 100644 --- a/pkg/controller/eks/addon/setup_test.go +++ b/pkg/controller/eks/addon/setup_test.go @@ -20,17 +20,15 @@ import ( "context" "testing" - "github.com/golang/mock/gomock" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "github.com/aws/aws-sdk-go/aws" awseks "github.com/aws/aws-sdk-go/service/eks" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/golang/mock/gomock" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/eks/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/eks/cluster/cluster.go b/pkg/controller/eks/cluster/cluster.go index dc49b9fd17..bd41636e06 100644 --- a/pkg/controller/eks/cluster/cluster.go +++ b/pkg/controller/eks/cluster/cluster.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awseks "github.com/aws/aws-sdk-go-v2/service/eks" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -169,7 +168,7 @@ func (e *external) Create(ctx context.Context, mg resource.Managed) (managed.Ext return managed.ExternalCreation{}, awsclient.Wrap(err, errCreateFailed) } -func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*v1beta1.Cluster) if !ok { return managed.ExternalUpdate{}, errors.New(errNotEKSCluster) diff --git a/pkg/controller/eks/cluster/cluster_test.go b/pkg/controller/eks/cluster/cluster_test.go index ee492fc8d1..5ae12d3580 100644 --- a/pkg/controller/eks/cluster/cluster_test.go +++ b/pkg/controller/eks/cluster/cluster_test.go @@ -22,14 +22,13 @@ import ( awseks "github.com/aws/aws-sdk-go-v2/service/eks" awsekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/eks/fargateprofile/controller.go b/pkg/controller/eks/fargateprofile/controller.go index 67a8f801d8..7e7e8eb93e 100644 --- a/pkg/controller/eks/fargateprofile/controller.go +++ b/pkg/controller/eks/fargateprofile/controller.go @@ -21,11 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awseks "github.com/aws/aws-sdk-go-v2/service/eks" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +28,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -124,7 +123,7 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex cr.Status.AtProvider = eks.GenerateFargateProfileObservation(rsp.FargateProfile) // Any of the statuses we don't explicitly address should be considered as // the fargate profile being unavailable. - switch cr.Status.AtProvider.Status { // nolint:exhaustive + switch cr.Status.AtProvider.Status { //nolint:exhaustive case v1beta1.FargateProfileStatusActive: cr.Status.SetConditions(xpv1.Available()) case v1beta1.FargateProfileStatusCreating: diff --git a/pkg/controller/eks/fargateprofile/controller_test.go b/pkg/controller/eks/fargateprofile/controller_test.go index 5df048938e..9be805bb20 100644 --- a/pkg/controller/eks/fargateprofile/controller_test.go +++ b/pkg/controller/eks/fargateprofile/controller_test.go @@ -20,22 +20,18 @@ import ( "context" "testing" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - - "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" - awseks "github.com/aws/aws-sdk-go-v2/service/eks" awsekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/crossplane-contrib/provider-aws/apis/eks/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/eks" "github.com/crossplane-contrib/provider-aws/pkg/clients/eks/fake" diff --git a/pkg/controller/eks/identityproviderconfig/controller.go b/pkg/controller/eks/identityproviderconfig/controller.go index 95a8587db5..403be80303 100644 --- a/pkg/controller/eks/identityproviderconfig/controller.go +++ b/pkg/controller/eks/identityproviderconfig/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awseks "github.com/aws/aws-sdk-go-v2/service/eks" "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -143,7 +142,7 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex // Any of the statuses we don't explicitly address should be considered as // the identity provider config being unavailable. - switch cr.Status.AtProvider.Status { // nolint:exhaustive + switch cr.Status.AtProvider.Status { //nolint:exhaustive case manualv1alpha1.IdentityProviderConfigStatusActive: cr.Status.SetConditions(xpv1.Available()) case manualv1alpha1.IdentityProviderConfigStatusCreating: diff --git a/pkg/controller/eks/identityproviderconfig/controller_test.go b/pkg/controller/eks/identityproviderconfig/controller_test.go index a155332ad4..850ec94b34 100644 --- a/pkg/controller/eks/identityproviderconfig/controller_test.go +++ b/pkg/controller/eks/identityproviderconfig/controller_test.go @@ -22,14 +22,13 @@ import ( awseks "github.com/aws/aws-sdk-go-v2/service/eks" awsekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/eks/nodegroup/controller.go b/pkg/controller/eks/nodegroup/controller.go index 9730c9ecd7..5ad22b61d7 100644 --- a/pkg/controller/eks/nodegroup/controller.go +++ b/pkg/controller/eks/nodegroup/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awseks "github.com/aws/aws-sdk-go-v2/service/eks" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -136,7 +135,7 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex cr.Status.AtProvider = eks.GenerateNodeGroupObservation(rsp.Nodegroup) // Any of the statuses we don't explicitly address should be considered as // the node group being unavailable. - switch cr.Status.AtProvider.Status { // nolint:exhaustive + switch cr.Status.AtProvider.Status { //nolint:exhaustive case manualv1alpha1.NodeGroupStatusActive: cr.Status.SetConditions(xpv1.Available()) case manualv1alpha1.NodeGroupStatusCreating: @@ -171,7 +170,7 @@ func (e *external) Update(ctx context.Context, mg resource.Managed) (managed.Ext if !ok { return managed.ExternalUpdate{}, errors.New(errNotEKSNodeGroup) } - switch cr.Status.AtProvider.Status { // nolint:exhaustive + switch cr.Status.AtProvider.Status { //nolint:exhaustive case manualv1alpha1.NodeGroupStatusUpdating, manualv1alpha1.NodeGroupStatusCreating: return managed.ExternalUpdate{}, nil } diff --git a/pkg/controller/eks/nodegroup/controller_test.go b/pkg/controller/eks/nodegroup/controller_test.go index e1a5ac17e4..5d49483295 100644 --- a/pkg/controller/eks/nodegroup/controller_test.go +++ b/pkg/controller/eks/nodegroup/controller_test.go @@ -22,14 +22,13 @@ import ( awseks "github.com/aws/aws-sdk-go-v2/service/eks" awsekstypes "github.com/aws/aws-sdk-go-v2/service/eks/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/eks/manualv1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/eks/setup.go b/pkg/controller/eks/setup.go index 75b3b55ee2..ebe558086c 100644 --- a/pkg/controller/eks/setup.go +++ b/pkg/controller/eks/setup.go @@ -17,9 +17,8 @@ limitations under the License. package eks import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/addon" "github.com/crossplane-contrib/provider-aws/pkg/controller/eks/cluster" diff --git a/pkg/controller/elasticache/cacheparametergroup/setup.go b/pkg/controller/elasticache/cacheparametergroup/setup.go index 9c1bc750cd..d28b17d559 100644 --- a/pkg/controller/elasticache/cacheparametergroup/setup.go +++ b/pkg/controller/elasticache/cacheparametergroup/setup.go @@ -21,11 +21,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +28,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elasticache/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/elasticache/cacheparametergroup/setup_test.go b/pkg/controller/elasticache/cacheparametergroup/setup_test.go index fd57b5d9f0..90559ff1e7 100644 --- a/pkg/controller/elasticache/cacheparametergroup/setup_test.go +++ b/pkg/controller/elasticache/cacheparametergroup/setup_test.go @@ -24,12 +24,10 @@ import ( "github.com/aws/aws-sdk-go/aws/request" svcsdk "github.com/aws/aws-sdk-go/service/elasticache" "github.com/aws/aws-sdk-go/service/elasticache/elasticacheiface" - + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" - "github.com/crossplane/crossplane-runtime/pkg/meta" - svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elasticache/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" ) diff --git a/pkg/controller/elasticache/setup.go b/pkg/controller/elasticache/setup.go index 61163daf0a..8eb8d4b85a 100644 --- a/pkg/controller/elasticache/setup.go +++ b/pkg/controller/elasticache/setup.go @@ -17,9 +17,8 @@ limitations under the License. package elasticache import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticache/cacheparametergroup" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/elasticloadbalancing/elb/controller.go b/pkg/controller/elasticloadbalancing/elb/controller.go index 9b4e2d16e3..75ff3e66a6 100644 --- a/pkg/controller/elasticloadbalancing/elb/controller.go +++ b/pkg/controller/elasticloadbalancing/elb/controller.go @@ -22,11 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awselb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" awselbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" elasticloadbalancingv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -112,7 +111,7 @@ type external struct { client elb.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*elasticloadbalancingv1alpha1.ELB) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) @@ -177,7 +176,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, awsclient.Wrap(err, errCreate) } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // //nolint:gocyclo cr, ok := mgd.(*elasticloadbalancingv1alpha1.ELB) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/elasticloadbalancing/elb/controller_test.go b/pkg/controller/elasticloadbalancing/elb/controller_test.go index f604cc6f61..ab76b72937 100644 --- a/pkg/controller/elasticloadbalancing/elb/controller_test.go +++ b/pkg/controller/elasticloadbalancing/elb/controller_test.go @@ -22,16 +22,14 @@ import ( awselb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" awselbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/elasticloadbalancing/elbattachment/controller.go b/pkg/controller/elasticloadbalancing/elbattachment/controller.go index 8d4ece2d0d..479ab281b6 100644 --- a/pkg/controller/elasticloadbalancing/elbattachment/controller.go +++ b/pkg/controller/elasticloadbalancing/elbattachment/controller.go @@ -22,16 +22,15 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awselb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" awselbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" elasticloadbalancingv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -107,7 +106,7 @@ type external struct { client elb.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { cr, ok := mgd.(*elasticloadbalancingv1alpha1.ELBAttachment) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/elasticloadbalancing/elbattachment/controller_test.go b/pkg/controller/elasticloadbalancing/elbattachment/controller_test.go index dd6fd05234..e6ee4af45f 100644 --- a/pkg/controller/elasticloadbalancing/elbattachment/controller_test.go +++ b/pkg/controller/elasticloadbalancing/elbattachment/controller_test.go @@ -22,15 +22,13 @@ import ( awselb "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing" awselbtypes "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/elasticloadbalancing/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/elasticloadbalancing/setup.go b/pkg/controller/elasticloadbalancing/setup.go index 2559a03fa0..fc48492df1 100644 --- a/pkg/controller/elasticloadbalancing/setup.go +++ b/pkg/controller/elasticloadbalancing/setup.go @@ -17,9 +17,8 @@ limitations under the License. package elasticloadbalancing import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elb" "github.com/crossplane-contrib/provider-aws/pkg/controller/elasticloadbalancing/elbattachment" diff --git a/pkg/controller/elbv2/listener/setup.go b/pkg/controller/elbv2/listener/setup.go index 915fc37eeb..c9472d8460 100644 --- a/pkg/controller/elbv2/listener/setup.go +++ b/pkg/controller/elbv2/listener/setup.go @@ -5,8 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/elbv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/elbv2/listener/setup_test.go b/pkg/controller/elbv2/listener/setup_test.go index c60e4939db..43250f0a81 100644 --- a/pkg/controller/elbv2/listener/setup_test.go +++ b/pkg/controller/elbv2/listener/setup_test.go @@ -3,9 +3,8 @@ package listener import ( "testing" - "github.com/google/go-cmp/cmp" - svcsdk "github.com/aws/aws-sdk-go/service/elbv2" + "github.com/google/go-cmp/cmp" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" ) diff --git a/pkg/controller/elbv2/loadbalancer/setup.go b/pkg/controller/elbv2/loadbalancer/setup.go index 06adc32a73..63cd9afacb 100644 --- a/pkg/controller/elbv2/loadbalancer/setup.go +++ b/pkg/controller/elbv2/loadbalancer/setup.go @@ -5,8 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/elbv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/elbv2/setup.go b/pkg/controller/elbv2/setup.go index d98fa5d64d..cef8942b24 100644 --- a/pkg/controller/elbv2/setup.go +++ b/pkg/controller/elbv2/setup.go @@ -17,9 +17,8 @@ limitations under the License. package elbv2 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/listener" "github.com/crossplane-contrib/provider-aws/pkg/controller/elbv2/loadbalancer" diff --git a/pkg/controller/elbv2/target/controller.go b/pkg/controller/elbv2/target/controller.go index c9d59ba884..ce753d562f 100644 --- a/pkg/controller/elbv2/target/controller.go +++ b/pkg/controller/elbv2/target/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awselasticloadbalancingv2 "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2" "github.com/aws/aws-sdk-go-v2/service/elasticloadbalancingv2/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/elbv2/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/elbv2/targetgroup/setup.go b/pkg/controller/elbv2/targetgroup/setup.go index 0fe5db819b..272ca9b97d 100644 --- a/pkg/controller/elbv2/targetgroup/setup.go +++ b/pkg/controller/elbv2/targetgroup/setup.go @@ -4,8 +4,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/elbv2" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -13,6 +11,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/emrcontainers/setup.go b/pkg/controller/emrcontainers/setup.go index 796f4b0440..073d65e69f 100644 --- a/pkg/controller/emrcontainers/setup.go +++ b/pkg/controller/emrcontainers/setup.go @@ -17,9 +17,8 @@ limitations under the License. package emrcontainers import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/jobrun" "github.com/crossplane-contrib/provider-aws/pkg/controller/emrcontainers/virtualcluster" diff --git a/pkg/controller/globalaccelerator/accelerator/setup.go b/pkg/controller/globalaccelerator/accelerator/setup.go index c36b117334..365554bf12 100644 --- a/pkg/controller/globalaccelerator/accelerator/setup.go +++ b/pkg/controller/globalaccelerator/accelerator/setup.go @@ -18,9 +18,8 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/globalaccelerator/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" - "github.com/crossplane-contrib/provider-aws/pkg/features" - awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/features" ) // SetupAccelerator adds a controller that reconciles an Accelerator. diff --git a/pkg/controller/globalaccelerator/listener/setup.go b/pkg/controller/globalaccelerator/listener/setup.go index 6389c8c1b3..a9f80d2a42 100644 --- a/pkg/controller/globalaccelerator/listener/setup.go +++ b/pkg/controller/globalaccelerator/listener/setup.go @@ -6,8 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/globalaccelerator" - "k8s.io/utils/ptr" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -15,6 +13,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/globalaccelerator/v1alpha1" diff --git a/pkg/controller/globalaccelerator/setup.go b/pkg/controller/globalaccelerator/setup.go index 3337d229a7..7871970cf7 100644 --- a/pkg/controller/globalaccelerator/setup.go +++ b/pkg/controller/globalaccelerator/setup.go @@ -14,9 +14,8 @@ limitations under the License. package globalaccelerator import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/globalaccelerator/accelerator" "github.com/crossplane-contrib/provider-aws/pkg/controller/globalaccelerator/endpointgroup" diff --git a/pkg/controller/glue/classifier/setup.go b/pkg/controller/glue/classifier/setup.go index 619a366d42..165d98944a 100644 --- a/pkg/controller/glue/classifier/setup.go +++ b/pkg/controller/glue/classifier/setup.go @@ -18,11 +18,6 @@ import ( "time" svcsdk "github.com/aws/aws-sdk-go/service/glue" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -30,6 +25,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/glue/connection/setup.go b/pkg/controller/glue/connection/setup.go index 234d781a56..9b26938144 100644 --- a/pkg/controller/glue/connection/setup.go +++ b/pkg/controller/glue/connection/setup.go @@ -22,12 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/glue" "github.com/aws/aws-sdk-go/service/glue/glueiface" svcsdksts "github.com/aws/aws-sdk-go/service/sts" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/glue/crawler/setup.go b/pkg/controller/glue/crawler/setup.go index 684f57bec8..76ffb1e7a7 100644 --- a/pkg/controller/glue/crawler/setup.go +++ b/pkg/controller/glue/crawler/setup.go @@ -23,12 +23,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/glue" "github.com/aws/aws-sdk-go/service/glue/glueiface" svcsdksts "github.com/aws/aws-sdk-go/service/sts" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +30,12 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -153,7 +153,7 @@ func postObserve(_ context.Context, cr *svcapitypes.Crawler, obj *svcsdk.GetCraw return obs, nil } -// nolint:gocyclo +//nolint:gocyclo func lateInitialize(spec *svcapitypes.CrawlerParameters, resp *svcsdk.GetCrawlerOutput) error { spec.Configuration = awsclients.LateInitializeStringPtr(spec.Configuration, resp.Crawler.Configuration) @@ -240,7 +240,7 @@ func (h *hooks) isUpToDate(_ context.Context, cr *svcapitypes.Crawler, resp *svc return areTagsUpToDate, "", err } -// nolint:gocyclo +//nolint:gocyclo func preUpdate(_ context.Context, cr *svcapitypes.Crawler, obj *svcsdk.UpdateCrawlerInput) error { obj.Name = awsclients.String(meta.GetExternalName(cr)) @@ -255,7 +255,7 @@ func preUpdate(_ context.Context, cr *svcapitypes.Crawler, obj *svcsdk.UpdateCra catTars := []*svcsdk.CatalogTarget{} for _, catTarsIter := range cr.Spec.ForProvider.Targets.CatalogTargets { catTarsElem := &svcsdk.CatalogTarget{ - DatabaseName: &catTarsIter.DatabaseName, + DatabaseName: ptr.To(catTarsIter.DatabaseName), Tables: awsclients.StringSliceToPtr(catTarsIter.Tables), } catTars = append(catTars, catTarsElem) @@ -330,7 +330,7 @@ func (h *hooks) postUpdate(ctx context.Context, cr *svcapitypes.Crawler, obj *sv return upd, svcutils.UpdateTagsForResource(ctx, h.client, cr.Spec.ForProvider.Tags, crawlerARN) } -// nolint:gocyclo +//nolint:gocyclo func preCreate(_ context.Context, cr *svcapitypes.Crawler, obj *svcsdk.CreateCrawlerInput) error { obj.Name = awsclients.String(meta.GetExternalName(cr)) @@ -345,7 +345,7 @@ func preCreate(_ context.Context, cr *svcapitypes.Crawler, obj *svcsdk.CreateCra catTars := []*svcsdk.CatalogTarget{} for _, catTarsIter := range cr.Spec.ForProvider.Targets.CatalogTargets { catTarsElem := &svcsdk.CatalogTarget{ - DatabaseName: &catTarsIter.DatabaseName, + DatabaseName: ptr.To(catTarsIter.DatabaseName), Tables: awsclients.StringSliceToPtr(catTarsIter.Tables), } catTars = append(catTars, catTarsElem) @@ -434,7 +434,8 @@ func (h *hooks) postCreate(ctx context.Context, cr *svcapitypes.Crawler, obj *sv } // Custom GenerateCrawler for isuptodate to fill the missing fields not forwarded by GenerateCrawler in zz_conversion.go -// nolint:gocyclo +// +//nolint:gocyclo func customGenerateCrawler(resp *svcsdk.GetCrawlerOutput) *svcapitypes.Crawler { cr := GenerateCrawler(resp) diff --git a/pkg/controller/glue/database/setup.go b/pkg/controller/glue/database/setup.go index ed8b246d1e..d82946cfcb 100644 --- a/pkg/controller/glue/database/setup.go +++ b/pkg/controller/glue/database/setup.go @@ -20,11 +20,6 @@ import ( "time" svcsdk "github.com/aws/aws-sdk-go/service/glue" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +27,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/glue/job/setup.go b/pkg/controller/glue/job/setup.go index 5e5639094e..777d9f2061 100644 --- a/pkg/controller/glue/job/setup.go +++ b/pkg/controller/glue/job/setup.go @@ -22,12 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/glue" "github.com/aws/aws-sdk-go/service/glue/glueiface" svcsdksts "github.com/aws/aws-sdk-go/service/sts" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/glue/securityconfiguration/setup.go b/pkg/controller/glue/securityconfiguration/setup.go index 5837cf686e..0eb7eccbc1 100644 --- a/pkg/controller/glue/securityconfiguration/setup.go +++ b/pkg/controller/glue/securityconfiguration/setup.go @@ -18,9 +18,6 @@ import ( "time" svcsdk "github.com/aws/aws-sdk-go/service/glue" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -28,6 +25,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/glue/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/glue/setup.go b/pkg/controller/glue/setup.go index e2f7fe87a9..0279bd592c 100644 --- a/pkg/controller/glue/setup.go +++ b/pkg/controller/glue/setup.go @@ -17,9 +17,8 @@ limitations under the License. package glue import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/classifier" "github.com/crossplane-contrib/provider-aws/pkg/controller/glue/connection" diff --git a/pkg/controller/iam/accesskey/controller.go b/pkg/controller/iam/accesskey/controller.go index b85291d87f..eec8234bfe 100644 --- a/pkg/controller/iam/accesskey/controller.go +++ b/pkg/controller/iam/accesskey/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/accesskey/controller_test.go b/pkg/controller/iam/accesskey/controller_test.go index 0655ed3c9d..63356080c4 100644 --- a/pkg/controller/iam/accesskey/controller_test.go +++ b/pkg/controller/iam/accesskey/controller_test.go @@ -23,15 +23,14 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/iam/group/controller.go b/pkg/controller/iam/group/controller.go index 7ec27788a3..6a58229af2 100644 --- a/pkg/controller/iam/group/controller.go +++ b/pkg/controller/iam/group/controller.go @@ -21,10 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +28,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/group/controller_test.go b/pkg/controller/iam/group/controller_test.go index 8f537cbbf2..ee24e45db5 100644 --- a/pkg/controller/iam/group/controller_test.go +++ b/pkg/controller/iam/group/controller_test.go @@ -23,14 +23,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/iam/grouppolicyattachment/controller.go b/pkg/controller/iam/grouppolicyattachment/controller.go index 460d07c3b8..d87e574ca7 100644 --- a/pkg/controller/iam/grouppolicyattachment/controller.go +++ b/pkg/controller/iam/grouppolicyattachment/controller.go @@ -23,10 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +30,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/grouppolicyattachment/controller_test.go b/pkg/controller/iam/grouppolicyattachment/controller_test.go index a3d5f7d892..cce1197387 100644 --- a/pkg/controller/iam/grouppolicyattachment/controller_test.go +++ b/pkg/controller/iam/grouppolicyattachment/controller_test.go @@ -20,19 +20,17 @@ import ( "context" "testing" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam/fake" diff --git a/pkg/controller/iam/groupusermembership/controller.go b/pkg/controller/iam/groupusermembership/controller.go index 44a98092c3..77ba83bfb5 100644 --- a/pkg/controller/iam/groupusermembership/controller.go +++ b/pkg/controller/iam/groupusermembership/controller.go @@ -23,10 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +30,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/groupusermembership/controller_test.go b/pkg/controller/iam/groupusermembership/controller_test.go index c74cdaeaff..051331aa3f 100644 --- a/pkg/controller/iam/groupusermembership/controller_test.go +++ b/pkg/controller/iam/groupusermembership/controller_test.go @@ -20,19 +20,17 @@ import ( "context" "testing" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam/fake" diff --git a/pkg/controller/iam/instanceprofile/setup.go b/pkg/controller/iam/instanceprofile/setup.go index a233a6af8b..f81e1aa1aa 100644 --- a/pkg/controller/iam/instanceprofile/setup.go +++ b/pkg/controller/iam/instanceprofile/setup.go @@ -21,8 +21,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/iam" svcsdkapi "github.com/aws/aws-sdk-go/service/iam/iamiface" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -30,6 +28,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/openidconnectprovider/controller.go b/pkg/controller/iam/openidconnectprovider/controller.go index 2963c3550f..c8be085e34 100644 --- a/pkg/controller/iam/openidconnectprovider/controller.go +++ b/pkg/controller/iam/openidconnectprovider/controller.go @@ -22,12 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +30,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -179,7 +178,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, nil } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo // NOTE(cebernardi) gocyclo is disabled because the method needs to check the different components (Thumbprint, // ClientID and Tags and it's updating them with dedicated calls, hence increasing the complexity diff --git a/pkg/controller/iam/openidconnectprovider/controller_test.go b/pkg/controller/iam/openidconnectprovider/controller_test.go index 24a1bacffd..5fe1310ade 100644 --- a/pkg/controller/iam/openidconnectprovider/controller_test.go +++ b/pkg/controller/iam/openidconnectprovider/controller_test.go @@ -20,23 +20,19 @@ import ( "context" "testing" - "github.com/pkg/errors" - - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" iamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" diff --git a/pkg/controller/iam/policy/controller.go b/pkg/controller/iam/policy/controller.go index 60763826a8..3634896bdf 100644 --- a/pkg/controller/iam/policy/controller.go +++ b/pkg/controller/iam/policy/controller.go @@ -24,10 +24,6 @@ import ( awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/aws/aws-sdk-go-v2/service/sts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +31,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -114,7 +113,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mgd resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.Policy) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/iam/policy/controller_test.go b/pkg/controller/iam/policy/controller_test.go index 09836914c1..08ecf8d3f7 100644 --- a/pkg/controller/iam/policy/controller_test.go +++ b/pkg/controller/iam/policy/controller_test.go @@ -19,27 +19,22 @@ package policy import ( "context" "net/url" - "testing" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - - "github.com/aws/smithy-go/middleware" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" "github.com/aws/aws-sdk-go-v2/service/sts" "github.com/aws/aws-sdk-go/aws" - - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - + "github.com/aws/smithy-go/middleware" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/iam/role/controller.go b/pkg/controller/iam/role/controller.go index fb4b220f1e..76359885f5 100644 --- a/pkg/controller/iam/role/controller.go +++ b/pkg/controller/iam/role/controller.go @@ -21,11 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +28,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -166,7 +165,7 @@ func (e *external) Create(ctx context.Context, mgd resource.Managed) (managed.Ex return managed.ExternalCreation{}, awsclient.Wrap(err, errCreate) } -func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *external) Update(ctx context.Context, mgd resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mgd.(*v1beta1.Role) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/iam/role/controller_test.go b/pkg/controller/iam/role/controller_test.go index a587176a9b..38afba0274 100644 --- a/pkg/controller/iam/role/controller_test.go +++ b/pkg/controller/iam/role/controller_test.go @@ -23,15 +23,14 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" diff --git a/pkg/controller/iam/rolepolicyattachment/controller.go b/pkg/controller/iam/rolepolicyattachment/controller.go index 75ec44d828..db71f19dd5 100644 --- a/pkg/controller/iam/rolepolicyattachment/controller.go +++ b/pkg/controller/iam/rolepolicyattachment/controller.go @@ -22,16 +22,15 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/rolepolicyattachment/controller_test.go b/pkg/controller/iam/rolepolicyattachment/controller_test.go index 5f4482e1ce..130d3e3e2d 100644 --- a/pkg/controller/iam/rolepolicyattachment/controller_test.go +++ b/pkg/controller/iam/rolepolicyattachment/controller_test.go @@ -22,13 +22,12 @@ import ( awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" v1beta1 "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/iam/servicelinkedrole/setup.go b/pkg/controller/iam/servicelinkedrole/setup.go index 2dd04ffbfa..0b13933474 100644 --- a/pkg/controller/iam/servicelinkedrole/setup.go +++ b/pkg/controller/iam/servicelinkedrole/setup.go @@ -19,9 +19,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/iam" svcsdkapi "github.com/aws/aws-sdk-go/service/iam/iamiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +26,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/setup.go b/pkg/controller/iam/setup.go index b503f94721..d215d435a8 100644 --- a/pkg/controller/iam/setup.go +++ b/pkg/controller/iam/setup.go @@ -17,9 +17,8 @@ limitations under the License. package iam import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/accesskey" "github.com/crossplane-contrib/provider-aws/pkg/controller/iam/group" diff --git a/pkg/controller/iam/user/controller.go b/pkg/controller/iam/user/controller.go index 6a05e82ffb..17b8fcfc56 100644 --- a/pkg/controller/iam/user/controller.go +++ b/pkg/controller/iam/user/controller.go @@ -22,12 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/user/controller_test.go b/pkg/controller/iam/user/controller_test.go index 6b0b389be7..3a1754fffd 100644 --- a/pkg/controller/iam/user/controller_test.go +++ b/pkg/controller/iam/user/controller_test.go @@ -20,21 +20,18 @@ import ( "context" "testing" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/iam/userpolicyattachment/controller.go b/pkg/controller/iam/userpolicyattachment/controller.go index de7b05f9f8..9e40eab788 100644 --- a/pkg/controller/iam/userpolicyattachment/controller.go +++ b/pkg/controller/iam/userpolicyattachment/controller.go @@ -22,16 +22,15 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iam/userpolicyattachment/controller_test.go b/pkg/controller/iam/userpolicyattachment/controller_test.go index 01d7a02fc2..bc94ac20ad 100644 --- a/pkg/controller/iam/userpolicyattachment/controller_test.go +++ b/pkg/controller/iam/userpolicyattachment/controller_test.go @@ -20,18 +20,16 @@ import ( "context" "testing" - "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" - awsiam "github.com/aws/aws-sdk-go-v2/service/iam" awsiamtypes "github.com/aws/aws-sdk-go-v2/service/iam/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "github.com/crossplane-contrib/provider-aws/apis/iam/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam" "github.com/crossplane-contrib/provider-aws/pkg/clients/iam/fake" diff --git a/pkg/controller/iot/policy/setup.go b/pkg/controller/iot/policy/setup.go index aaa9369c7e..d007418615 100644 --- a/pkg/controller/iot/policy/setup.go +++ b/pkg/controller/iot/policy/setup.go @@ -21,8 +21,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/iot" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -30,6 +28,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iot/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/iot/setup.go b/pkg/controller/iot/setup.go index 4d6463e722..da4ea13da9 100644 --- a/pkg/controller/iot/setup.go +++ b/pkg/controller/iot/setup.go @@ -17,9 +17,8 @@ limitations under the License. package iot import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/policy" "github.com/crossplane-contrib/provider-aws/pkg/controller/iot/thing" diff --git a/pkg/controller/iot/thing/setup.go b/pkg/controller/iot/thing/setup.go index 1d35726c50..4f82bd49e3 100644 --- a/pkg/controller/iot/thing/setup.go +++ b/pkg/controller/iot/thing/setup.go @@ -22,9 +22,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/iot" - "github.com/google/go-cmp/cmp" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +29,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + ctrl "sigs.k8s.io/controller-runtime" iottypes "github.com/crossplane-contrib/provider-aws/apis/iot/v1alpha1" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iot/v1alpha1" diff --git a/pkg/controller/iot/thing/setup_test.go b/pkg/controller/iot/thing/setup_test.go index c4c7b5ae98..b8e44f085c 100644 --- a/pkg/controller/iot/thing/setup_test.go +++ b/pkg/controller/iot/thing/setup_test.go @@ -21,9 +21,8 @@ import ( "testing" "github.com/aws/aws-sdk-go/service/iot" - "github.com/google/go-cmp/cmp" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" "github.com/crossplane-contrib/provider-aws/apis/iot/v1alpha1" ) diff --git a/pkg/controller/kafka/cluster/setup.go b/pkg/controller/kafka/cluster/setup.go index 2e9924e0e2..4e7a6e1b28 100644 --- a/pkg/controller/kafka/cluster/setup.go +++ b/pkg/controller/kafka/cluster/setup.go @@ -18,12 +18,8 @@ import ( "strings" "github.com/aws/aws-sdk-go/aws" - "github.com/pkg/errors" - svcsdk "github.com/aws/aws-sdk-go/service/kafka" "github.com/aws/aws-sdk-go/service/kafka/kafkaiface" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -32,6 +28,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kafka/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -194,7 +192,6 @@ func postCreate(_ context.Context, cr *svcapitypes.Cluster, obj *svcsdk.CreateCl // LateInitialize fills the empty fields in *svcapitypes.ClusterParameters with // the values seen in svcsdk.DescribeClusterOutput. -// nolint:gocyclo func LateInitialize(cr *svcapitypes.ClusterParameters, obj *svcsdk.DescribeClusterOutput) error { if cr.EnhancedMonitoring == nil && obj.ClusterInfo.EnhancedMonitoring != nil { @@ -233,7 +230,7 @@ func LateInitialize(cr *svcapitypes.ClusterParameters, obj *svcsdk.DescribeClust return nil } -func isUpToDate(_ context.Context, wanted *svcapitypes.Cluster, current *svcsdk.DescribeClusterOutput) (bool, string, error) { // nolint:gocyclo +func isUpToDate(_ context.Context, wanted *svcapitypes.Cluster, current *svcsdk.DescribeClusterOutput) (bool, string, error) { forProvider := wanted.Spec.ForProvider clusterInfo := current.ClusterInfo @@ -272,7 +269,7 @@ func isInstanceTypeUpToDate(wanted *svcapitypes.CustomBrokerNodeGroupInfo, curre return true } -func isStorageInfoUpToDate(wanted *svcapitypes.CustomBrokerNodeGroupInfo, current *svcsdk.BrokerNodeGroupInfo) bool { // nolint:gocyclo +func isStorageInfoUpToDate(wanted *svcapitypes.CustomBrokerNodeGroupInfo, current *svcsdk.BrokerNodeGroupInfo) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -343,7 +340,7 @@ func isSomeLoggingEnabled(wanted *svcapitypes.LoggingInfo) bool { return false } -func isLoggingInfoUpToDate(wanted *svcapitypes.LoggingInfo, current *svcsdk.LoggingInfo) bool { // nolint:gocyclo +func isLoggingInfoUpToDate(wanted *svcapitypes.LoggingInfo, current *svcsdk.LoggingInfo) bool { //nolint:gocyclo if wanted != nil { if current == nil { @@ -422,7 +419,7 @@ func isLoggingInfoUpToDate(wanted *svcapitypes.LoggingInfo, current *svcsdk.Logg return true } -func isOpenMonitoringInfoUpToDate(wanted *svcapitypes.OpenMonitoringInfo, current *svcsdk.OpenMonitoring) bool { // nolint:gocyclo +func isOpenMonitoringInfoUpToDate(wanted *svcapitypes.OpenMonitoringInfo, current *svcsdk.OpenMonitoring) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -507,7 +504,7 @@ func isTagsUpToDate(wanted map[string]*string, current map[string]*string) bool return true } -func isEncryptionInfoInTransitUpToDate(wanted *svcapitypes.EncryptionInfo, current *svcsdk.EncryptionInfo) bool { // nolint:gocyclo +func isEncryptionInfoInTransitUpToDate(wanted *svcapitypes.EncryptionInfo, current *svcsdk.EncryptionInfo) bool { if wanted != nil { if current == nil { return false @@ -528,7 +525,7 @@ func isEncryptionInfoInTransitUpToDate(wanted *svcapitypes.EncryptionInfo, curre return true } -func isClientAuthenticationUpToDate(wanted *svcapitypes.ClientAuthentication, current *svcsdk.ClientAuthentication) bool { // nolint:gocyclo +func isClientAuthenticationUpToDate(wanted *svcapitypes.ClientAuthentication, current *svcsdk.ClientAuthentication) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -606,7 +603,7 @@ type updater struct { client kafkaiface.KafkaAPI } -func (u *updater) update(ctx context.Context, mg cpresource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (u *updater) update(ctx context.Context, mg cpresource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*svcapitypes.Cluster) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) @@ -866,7 +863,7 @@ func generateTags(wanted map[string]*string) map[string]*string { return nil } -func generateClientAuthentication(wanted *svcapitypes.ClientAuthentication) *svcsdk.ClientAuthentication { // nolint:gocyclo +func generateClientAuthentication(wanted *svcapitypes.ClientAuthentication) *svcsdk.ClientAuthentication { //nolint:gocyclo if wanted != nil { output := &svcsdk.ClientAuthentication{} @@ -928,7 +925,7 @@ func generateCustomConfigurationInfo(wanted *svcapitypes.CustomConfigurationInfo } -func generateLoggingInfoInput(wanted *svcapitypes.LoggingInfo) *svcsdk.LoggingInfo { // nolint:gocyclo +func generateLoggingInfoInput(wanted *svcapitypes.LoggingInfo) *svcsdk.LoggingInfo { //nolint:gocyclo output := &svcsdk.LoggingInfo{} if wanted.BrokerLogs != nil { diff --git a/pkg/controller/kafka/configuration/setup.go b/pkg/controller/kafka/configuration/setup.go index 91b25fa2d0..51c49421d4 100644 --- a/pkg/controller/kafka/configuration/setup.go +++ b/pkg/controller/kafka/configuration/setup.go @@ -17,16 +17,15 @@ import ( "context" "strings" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/kafka" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kafka/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/kafka/setup.go b/pkg/controller/kafka/setup.go index 5092bb31bb..c3372ae5ef 100644 --- a/pkg/controller/kafka/setup.go +++ b/pkg/controller/kafka/setup.go @@ -17,9 +17,8 @@ limitations under the License. package kafka import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/cluster" "github.com/crossplane-contrib/provider-aws/pkg/controller/kafka/configuration" diff --git a/pkg/controller/kinesis/setup.go b/pkg/controller/kinesis/setup.go index 90bba8f19d..d37aebf6c9 100644 --- a/pkg/controller/kinesis/setup.go +++ b/pkg/controller/kinesis/setup.go @@ -17,9 +17,8 @@ limitations under the License. package kinesis import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/kinesis/stream" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/kinesis/stream/setup.go b/pkg/controller/kinesis/stream/setup.go index a649084acd..c9a6227649 100644 --- a/pkg/controller/kinesis/stream/setup.go +++ b/pkg/controller/kinesis/stream/setup.go @@ -18,9 +18,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/kinesis" svcsdkapi "github.com/aws/aws-sdk-go/service/kinesis/kinesisiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -28,6 +25,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kinesis/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -132,7 +131,7 @@ type updater struct { client svcsdkapi.KinesisAPI } -func (u *updater) isUpToDate(_ context.Context, cr *svcapitypes.Stream, obj *svcsdk.DescribeStreamOutput) (bool, string, error) { // nolint:gocyclo +func (u *updater) isUpToDate(_ context.Context, cr *svcapitypes.Stream, obj *svcsdk.DescribeStreamOutput) (bool, string, error) { //nolint:gocyclo // ResourceInUseException: Stream example-stream not ACTIVE, instead in state CREATING if awsclients.StringValue(obj.StreamDescription.StreamStatus) == svcsdk.StreamStatusActive { @@ -181,7 +180,7 @@ func (u *updater) isUpToDate(_ context.Context, cr *svcapitypes.Stream, obj *svc return true, "", nil } -func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*svcapitypes.Stream) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) @@ -445,7 +444,7 @@ func DiffTags(local []svcapitypes.CustomTag, remote []*svcsdk.Tag) (add map[stri // GenerateObservation is used to produce v1beta1.ClusterObservation from // ekstypes.Cluster. -func GenerateObservation(obj *svcsdk.StreamDescription) svcapitypes.StreamObservation { // nolint:gocyclo +func GenerateObservation(obj *svcsdk.StreamDescription) svcapitypes.StreamObservation { //nolint:gocyclo if obj == nil { return svcapitypes.StreamObservation{} } diff --git a/pkg/controller/kms/alias/controller.go b/pkg/controller/kms/alias/controller.go index 6d2c4f86ff..9d9e905421 100644 --- a/pkg/controller/kms/alias/controller.go +++ b/pkg/controller/kms/alias/controller.go @@ -25,14 +25,13 @@ import ( svcapi "github.com/aws/aws-sdk-go/service/kms" svcsdk "github.com/aws/aws-sdk-go/service/kms" svcsdkapi "github.com/aws/aws-sdk-go/service/kms/kmsiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/kms/alias/setup.go b/pkg/controller/kms/alias/setup.go index 05d631cdea..16d9b244ed 100644 --- a/pkg/controller/kms/alias/setup.go +++ b/pkg/controller/kms/alias/setup.go @@ -16,16 +16,15 @@ package alias import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/kms" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/kms/key/setup.go b/pkg/controller/kms/key/setup.go index 34418216b6..47d1cbd54a 100644 --- a/pkg/controller/kms/key/setup.go +++ b/pkg/controller/kms/key/setup.go @@ -5,9 +5,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/kms" svcsdkapi "github.com/aws/aws-sdk-go/service/kms/kmsiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -15,6 +12,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/kms/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -289,7 +288,7 @@ func (o *observer) lateInitialize(in *svcapitypes.KeyParameters, obj *svcsdk.Des return nil } -func (o *observer) isUpToDate(_ context.Context, cr *svcapitypes.Key, obj *svcsdk.DescribeKeyOutput) (bool, string, error) { // nolint:gocyclo +func (o *observer) isUpToDate(_ context.Context, cr *svcapitypes.Key, obj *svcsdk.DescribeKeyOutput) (bool, string, error) { //nolint:gocyclo // Description if obj.KeyMetadata.Description != nil && cr.Spec.ForProvider.Description != nil && diff --git a/pkg/controller/kms/setup.go b/pkg/controller/kms/setup.go index 2b2ebdb3b5..f9bfdee44d 100644 --- a/pkg/controller/kms/setup.go +++ b/pkg/controller/kms/setup.go @@ -17,9 +17,8 @@ limitations under the License. package kms import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/alias" "github.com/crossplane-contrib/provider-aws/pkg/controller/kms/key" diff --git a/pkg/controller/lambda/function/setup.go b/pkg/controller/lambda/function/setup.go index 62345356fe..d4dba4452d 100644 --- a/pkg/controller/lambda/function/setup.go +++ b/pkg/controller/lambda/function/setup.go @@ -6,11 +6,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/lambda" svcsdkapi "github.com/aws/aws-sdk-go/service/lambda/lambdaiface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -18,6 +13,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/lambda/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -138,7 +137,7 @@ func preDelete(_ context.Context, cr *svcapitypes.Function, obj *svcsdk.DeleteFu return false, nil } -// nolint:gocyclo +//nolint:gocyclo func isUpToDate(_ context.Context, cr *svcapitypes.Function, obj *svcsdk.GetFunctionOutput) (bool, string, error) { // Compare CODE @@ -358,7 +357,7 @@ func (u *updater) isLastUpdateStatusSuccessful(ctx context.Context, cr *svcapity } } -// nolint:gocyclo +//nolint:gocyclo func (u *updater) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { cr, ok := mg.(*svcapitypes.Function) if !ok { @@ -454,7 +453,8 @@ func GenerateUpdateFunctionCodeInput(cr *svcapitypes.Function) *svcsdk.UpdateFun // GenerateUpdateFunctionConfigurationInput is similar to GenerateCreateFunctionConfigurationInput // Copied almost verbatim from the zz_conversions generated code -// nolint:gocyclo +// +//nolint:gocyclo func GenerateUpdateFunctionConfigurationInput(cr *svcapitypes.Function) *svcsdk.UpdateFunctionConfigurationInput { res := &svcsdk.UpdateFunctionConfigurationInput{} res.SetFunctionName(cr.Name) diff --git a/pkg/controller/lambda/function/setup_test.go b/pkg/controller/lambda/function/setup_test.go index 547db07ab7..edc048bfa1 100644 --- a/pkg/controller/lambda/function/setup_test.go +++ b/pkg/controller/lambda/function/setup_test.go @@ -3,8 +3,6 @@ package function import ( "testing" - svcapitypesv1beta1 "github.com/crossplane-contrib/provider-aws/apis/lambda/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" svcsdk "github.com/aws/aws-sdk-go/service/lambda" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" @@ -12,6 +10,7 @@ import ( "github.com/google/go-cmp/cmp" "github.com/crossplane-contrib/provider-aws/apis/lambda/v1beta1" + svcapitypesv1beta1 "github.com/crossplane-contrib/provider-aws/apis/lambda/v1beta1" ) type args struct { diff --git a/pkg/controller/lambda/functionurlconfig/setup.go b/pkg/controller/lambda/functionurlconfig/setup.go index 7cd7b0d049..67c7bbac7e 100644 --- a/pkg/controller/lambda/functionurlconfig/setup.go +++ b/pkg/controller/lambda/functionurlconfig/setup.go @@ -5,22 +5,19 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/lambda" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/lambda/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" - "github.com/crossplane-contrib/provider-aws/pkg/features" - aws "github.com/crossplane-contrib/provider-aws/pkg/clients" + "github.com/crossplane-contrib/provider-aws/pkg/features" ) // SetupFunctionURL adds a controller that reconciles FunctionURLConfig. diff --git a/pkg/controller/lambda/permission/controller.go b/pkg/controller/lambda/permission/controller.go index f604b8ab43..41c4052d28 100644 --- a/pkg/controller/lambda/permission/controller.go +++ b/pkg/controller/lambda/permission/controller.go @@ -23,12 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" svcsdk "github.com/aws/aws-sdk-go-v2/service/lambda" svcsdktypes "github.com/aws/aws-sdk-go-v2/service/lambda/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -36,6 +30,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/lambda/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/lambda/permission/conversion.go b/pkg/controller/lambda/permission/conversion.go index dfb1a6441c..dd7892bebf 100644 --- a/pkg/controller/lambda/permission/conversion.go +++ b/pkg/controller/lambda/permission/conversion.go @@ -18,7 +18,6 @@ package permission import ( svcsdk "github.com/aws/aws-sdk-go-v2/service/lambda" - "github.com/crossplane/crossplane-runtime/pkg/meta" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/lambda/manualv1alpha1" diff --git a/pkg/controller/lambda/setup.go b/pkg/controller/lambda/setup.go index 4ceb442952..f91541f89d 100644 --- a/pkg/controller/lambda/setup.go +++ b/pkg/controller/lambda/setup.go @@ -17,9 +17,8 @@ limitations under the License. package lambda import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/function" "github.com/crossplane-contrib/provider-aws/pkg/controller/lambda/functionurlconfig" diff --git a/pkg/controller/mq/broker/setup.go b/pkg/controller/mq/broker/setup.go index dbc9eaad0d..95e6996df9 100644 --- a/pkg/controller/mq/broker/setup.go +++ b/pkg/controller/mq/broker/setup.go @@ -4,11 +4,6 @@ import ( "context" "time" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - svcsdk "github.com/aws/aws-sdk-go/service/mq" svcsdkapi "github.com/aws/aws-sdk-go/service/mq/mqiface" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" @@ -18,6 +13,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/mq/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -82,7 +81,7 @@ func preObserve(_ context.Context, cr *svcapitypes.Broker, obj *svcsdk.DescribeB return nil } -// nolint:gocyclo +//nolint:gocyclo func (e *custom) postObserve(ctx context.Context, cr *svcapitypes.Broker, obj *svcsdk.DescribeBrokerResponse, obs managed.ExternalObservation, err error) (managed.ExternalObservation, error) { if err != nil { return managed.ExternalObservation{}, err @@ -175,7 +174,8 @@ func postCreate(_ context.Context, cr *svcapitypes.Broker, obj *svcsdk.CreateBro // LateInitialize fills the empty fields in *svcapitypes.BrokerParameters with // the values seen in svcsdk.DescribeBrokerResponse. -// nolint:gocyclo +// +//nolint:gocyclo func LateInitialize(cr *svcapitypes.BrokerParameters, obj *svcsdk.DescribeBrokerResponse) error { if cr.AuthenticationStrategy == nil && obj.AuthenticationStrategy != nil { cr.AuthenticationStrategy = awsclients.LateInitializeStringPtr(cr.AuthenticationStrategy, obj.AuthenticationStrategy) diff --git a/pkg/controller/mq/setup.go b/pkg/controller/mq/setup.go index 199f19bb44..6652c8ea83 100644 --- a/pkg/controller/mq/setup.go +++ b/pkg/controller/mq/setup.go @@ -17,9 +17,8 @@ limitations under the License. package mq import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/mwaa/environment" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/mq/user/setup.go b/pkg/controller/mq/user/setup.go index a36befc24a..5c5c6b15c9 100644 --- a/pkg/controller/mq/user/setup.go +++ b/pkg/controller/mq/user/setup.go @@ -6,10 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/mq" svcsdkapi "github.com/aws/aws-sdk-go/service/mq/mqiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -17,6 +13,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/mq/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/mwaa/environment/setup.go b/pkg/controller/mwaa/environment/setup.go index ac965c6fa8..1efa8009dc 100644 --- a/pkg/controller/mwaa/environment/setup.go +++ b/pkg/controller/mwaa/environment/setup.go @@ -3,9 +3,6 @@ package environment import ( "context" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - svcsdk "github.com/aws/aws-sdk-go/service/mwaa" svcsdkapi "github.com/aws/aws-sdk-go/service/mwaa/mwaaiface" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" @@ -17,6 +14,8 @@ import ( "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/mwaa/v1alpha1" awsclients "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/mwaa/setup.go b/pkg/controller/mwaa/setup.go index 77f6af5cb7..6f906e5026 100644 --- a/pkg/controller/mwaa/setup.go +++ b/pkg/controller/mwaa/setup.go @@ -17,9 +17,8 @@ limitations under the License. package mwaa import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/broker" "github.com/crossplane-contrib/provider-aws/pkg/controller/mq/user" diff --git a/pkg/controller/neptune/dbcluster/setup.go b/pkg/controller/neptune/dbcluster/setup.go index b6cbd700f4..f3dec3c11b 100644 --- a/pkg/controller/neptune/dbcluster/setup.go +++ b/pkg/controller/neptune/dbcluster/setup.go @@ -18,10 +18,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/neptune" svcsdkapi "github.com/aws/aws-sdk-go/service/neptune/neptuneiface" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +25,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/neptune/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -188,7 +187,7 @@ func lateInitialize(in *svcapitypes.DBClusterParameters, out *svcsdk.DescribeDBC return nil } -// nolint:gocyclo +//nolint:gocyclo func isUpToDate(_ context.Context, cr *svcapitypes.DBCluster, output *svcsdk.DescribeDBClustersOutput) (bool, string, error) { in := cr.Spec.ForProvider out := output.DBClusters[0] diff --git a/pkg/controller/neptune/setup.go b/pkg/controller/neptune/setup.go index 0dcc156912..7e87353381 100644 --- a/pkg/controller/neptune/setup.go +++ b/pkg/controller/neptune/setup.go @@ -17,9 +17,8 @@ limitations under the License. package neptune import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/neptune/dbcluster" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/opensearchservice/domain/setup.go b/pkg/controller/opensearchservice/domain/setup.go index 2b91c8aee1..a87fc4a57a 100644 --- a/pkg/controller/opensearchservice/domain/setup.go +++ b/pkg/controller/opensearchservice/domain/setup.go @@ -16,6 +16,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/opensearchservice/v1alpha1" @@ -151,7 +152,7 @@ func postObserve(_ context.Context, cr *svcapitypes.Domain, resp *svcsdk.Describ } // GenerateObservation is used to produce DomainObservation -func GenerateObservation(obj *svcsdk.DomainStatus) svcapitypes.DomainObservation { // nolint:gocyclo +func GenerateObservation(obj *svcsdk.DomainStatus) svcapitypes.DomainObservation { //nolint:gocyclo if obj == nil { return svcapitypes.DomainObservation{} } @@ -359,7 +360,7 @@ func GenerateObservation(obj *svcsdk.DomainStatus) svcapitypes.DomainObservation return o } -func isUpToDate(_ context.Context, obj *svcapitypes.Domain, out *svcsdk.DescribeDomainOutput) (bool, string, error) { // nolint:gocyclo +func isUpToDate(_ context.Context, obj *svcapitypes.Domain, out *svcsdk.DescribeDomainOutput) (bool, string, error) { switch { case aws.StringValue(obj.Spec.ForProvider.AccessPolicies) != aws.StringValue(out.DomainStatus.AccessPolicies), @@ -385,7 +386,7 @@ func isUpToDate(_ context.Context, obj *svcapitypes.Domain, out *svcsdk.Describe } } -func lateInitialize(cr *svcapitypes.DomainParameters, resp *svcsdk.DescribeDomainOutput) error { // nolint:gocyclo +func lateInitialize(cr *svcapitypes.DomainParameters, resp *svcsdk.DescribeDomainOutput) error { //nolint:gocyclo if resp.DomainStatus.AccessPolicies != nil && resp.DomainStatus.AccessPolicies == nil { cr.AccessPolicies = resp.DomainStatus.AccessPolicies @@ -808,7 +809,7 @@ type updateDomain struct { client svcsdkapi.OpenSearchServiceAPI } -func (e *updateDomain) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *updateDomain) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*svcapitypes.Domain) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) @@ -938,7 +939,7 @@ out: return true } -func isAdvancedSecurityOptionsUpToDate(wanted *svcapitypes.AdvancedSecurityOptionsInput, current *svcsdk.AdvancedSecurityOptions) bool { // nolint:gocyclo +func isAdvancedSecurityOptionsUpToDate(wanted *svcapitypes.AdvancedSecurityOptionsInput, current *svcsdk.AdvancedSecurityOptions) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -991,7 +992,7 @@ func isAdvancedSecurityOptionsUpToDate(wanted *svcapitypes.AdvancedSecurityOptio return true } -func isClusterConfigUpToDate(wanted *svcapitypes.ClusterConfig, current *svcsdk.ClusterConfig) bool { // nolint:gocyclo +func isClusterConfigUpToDate(wanted *svcapitypes.ClusterConfig, current *svcsdk.ClusterConfig) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -1226,7 +1227,7 @@ func isSnapshotOptionsUpToDate(wanted *svcapitypes.SnapshotOptions, current *svc return true } -func isVpcOptionsUpToDate(wanted *svcapitypes.CustomVPCDerivedInfo, current *svcsdk.VPCDerivedInfo) bool { // nolint:gocyclo +func isVpcOptionsUpToDate(wanted *svcapitypes.CustomVPCDerivedInfo, current *svcsdk.VPCDerivedInfo) bool { //nolint:gocyclo if wanted != nil { if current == nil { return false @@ -1340,7 +1341,7 @@ func generateAutotuneOptionsInput(wanted *svcapitypes.AutoTuneOptionsInput) *svc } } if ms.StartAt != nil { - msNew.StartAt = &ms.StartAt.Time + msNew.StartAt = ptr.To(ms.StartAt.Time) } msList = append(msList, msNew) } diff --git a/pkg/controller/opensearchservice/setup.go b/pkg/controller/opensearchservice/setup.go index 819f9a6f08..9e698a78a5 100644 --- a/pkg/controller/opensearchservice/setup.go +++ b/pkg/controller/opensearchservice/setup.go @@ -17,9 +17,8 @@ limitations under the License. package opensearchservice import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/opensearchservice/domain" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go b/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go index 43e4a2e378..09440a662b 100644 --- a/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go +++ b/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go @@ -5,8 +5,6 @@ import ( "context" "strings" - ctrl "sigs.k8s.io/controller-runtime" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/prometheusservice" svcsdkapi "github.com/aws/aws-sdk-go/service/prometheusservice/prometheusserviceiface" @@ -18,6 +16,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/prometheusservice/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go b/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go index a4ceb926fa..9a007a9a12 100644 --- a/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go +++ b/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go @@ -5,9 +5,6 @@ import ( "context" "strings" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/prometheusservice" svcsdkapi "github.com/aws/aws-sdk-go/service/prometheusservice/prometheusserviceiface" @@ -19,6 +16,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/prometheusservice/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/prometheusservice/setup.go b/pkg/controller/prometheusservice/setup.go index e11e148082..a26cd64125 100644 --- a/pkg/controller/prometheusservice/setup.go +++ b/pkg/controller/prometheusservice/setup.go @@ -17,9 +17,8 @@ limitations under the License. package prometheusservice import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/alertmanagerdefinition" "github.com/crossplane-contrib/provider-aws/pkg/controller/prometheusservice/rulegroupsnamespace" diff --git a/pkg/controller/prometheusservice/workspace/setup.go b/pkg/controller/prometheusservice/workspace/setup.go index d6446d1349..ca69324ea6 100644 --- a/pkg/controller/prometheusservice/workspace/setup.go +++ b/pkg/controller/prometheusservice/workspace/setup.go @@ -6,10 +6,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/prometheusservice" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -17,6 +13,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/prometheusservice/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ram/resourceshare/setup.go b/pkg/controller/ram/resourceshare/setup.go index 7a792dffa0..bdf797f307 100644 --- a/pkg/controller/ram/resourceshare/setup.go +++ b/pkg/controller/ram/resourceshare/setup.go @@ -16,16 +16,15 @@ package resourceshare import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/ram" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ram/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/ram/setup.go b/pkg/controller/ram/setup.go index 3e309a4224..554b196dfc 100644 --- a/pkg/controller/ram/setup.go +++ b/pkg/controller/ram/setup.go @@ -17,9 +17,8 @@ limitations under the License. package ram import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/ram/resourceshare" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/rds/dbcluster/setup.go b/pkg/controller/rds/dbcluster/setup.go index 2530c26cee..2a5092d031 100644 --- a/pkg/controller/rds/dbcluster/setup.go +++ b/pkg/controller/rds/dbcluster/setup.go @@ -6,10 +6,18 @@ import ( "strconv" "strings" - "github.com/google/go-cmp/cmp" - svcsdk "github.com/aws/aws-sdk-go/service/rds" svcsdkapi "github.com/aws/aws-sdk-go/service/rds/rdsiface" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" + "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/password" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/resource" + cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" @@ -20,16 +28,6 @@ import ( dbinstance "github.com/crossplane-contrib/provider-aws/pkg/clients/rds" "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/connection" - "github.com/crossplane/crossplane-runtime/pkg/controller" - "github.com/crossplane/crossplane-runtime/pkg/event" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/crossplane/crossplane-runtime/pkg/password" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/resource" - cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" ) // error constants @@ -137,7 +135,7 @@ func (e *custom) postObserve(ctx context.Context, cr *svcapitypes.DBCluster, res return obs, nil } -func (e *custom) preCreate(ctx context.Context, cr *svcapitypes.DBCluster, obj *svcsdk.CreateDBClusterInput) (err error) { // nolint:gocyclo +func (e *custom) preCreate(ctx context.Context, cr *svcapitypes.DBCluster, obj *svcsdk.CreateDBClusterInput) (err error) { //nolint:gocyclo restoreFrom := cr.Spec.ForProvider.RestoreFrom autogenerate := cr.Spec.ForProvider.AutogeneratePassword masterUserPasswordSecretRef := cr.Spec.ForProvider.MasterUserPasswordSecretRef @@ -206,7 +204,7 @@ func (e *custom) preCreate(ctx context.Context, cr *svcapitypes.DBCluster, obj * return nil } -func generateRestoreDBClusterFromS3Input(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromS3Input { // nolint:gocyclo +func generateRestoreDBClusterFromS3Input(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromS3Input { //nolint:gocyclo res := &svcsdk.RestoreDBClusterFromS3Input{} if cr.Spec.ForProvider.AvailabilityZones != nil { @@ -342,7 +340,7 @@ func generateRestoreDBClusterFromS3Input(cr *svcapitypes.DBCluster) *svcsdk.Rest return res } -func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromSnapshotInput { // nolint:gocyclo +func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterFromSnapshotInput { //nolint:gocyclo res := &svcsdk.RestoreDBClusterFromSnapshotInput{} if cr.Spec.ForProvider.AvailabilityZones != nil { @@ -475,7 +473,7 @@ func generateRestoreDBClusterFromSnapshotInput(cr *svcapitypes.DBCluster) *svcsd return res } -func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterToPointInTimeInput { // nolint:gocyclo +func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcsdk.RestoreDBClusterToPointInTimeInput { //nolint:gocyclo p := cr.Spec.ForProvider res := &svcsdk.RestoreDBClusterToPointInTimeInput{ @@ -553,7 +551,7 @@ func generateRestoreDBClusterToPointInTimeInput(cr *svcapitypes.DBCluster) *svcs return res } -func (e *custom) isUpToDate(ctx context.Context, cr *svcapitypes.DBCluster, out *svcsdk.DescribeDBClustersOutput) (bool, string, error) { // nolint:gocyclo +func (e *custom) isUpToDate(ctx context.Context, cr *svcapitypes.DBCluster, out *svcsdk.DescribeDBClustersOutput) (bool, string, error) { //nolint:gocyclo status := aws.StringValue(out.DBClusters[0].Status) if status == "modifying" || status == "upgrading" || status == "configuring-iam-database-auth" || status == "migrating" || status == "prepairing-data-migration" || status == "creating" { return true, "", nil @@ -767,7 +765,7 @@ func (e *custom) preUpdate(ctx context.Context, cr *svcapitypes.DBCluster, obj * return nil } -// nolint:gocyclo +//nolint:gocyclo func (e *custom) postUpdate(ctx context.Context, cr *svcapitypes.DBCluster, obj *svcsdk.ModifyDBClusterOutput, upd managed.ExternalUpdate, err error) (managed.ExternalUpdate, error) { if err != nil { return upd, err diff --git a/pkg/controller/rds/dbcluster/setup_test.go b/pkg/controller/rds/dbcluster/setup_test.go index 2af97e3c3a..8c3db1e7de 100644 --- a/pkg/controller/rds/dbcluster/setup_test.go +++ b/pkg/controller/rds/dbcluster/setup_test.go @@ -4,10 +4,9 @@ import ( "testing" svcsdk "github.com/aws/aws-sdk-go/service/rds" + "github.com/google/go-cmp/cmp" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" - - "github.com/google/go-cmp/cmp" ) func ptr(str string) *string { diff --git a/pkg/controller/rds/dbclusterparametergroup/setup.go b/pkg/controller/rds/dbclusterparametergroup/setup.go index 11a50bec56..0148ef6fa5 100644 --- a/pkg/controller/rds/dbclusterparametergroup/setup.go +++ b/pkg/controller/rds/dbclusterparametergroup/setup.go @@ -3,13 +3,8 @@ package dbclusterparametergroup import ( "context" - "github.com/pkg/errors" - svcsdk "github.com/aws/aws-sdk-go/service/rds" svcsdkapi "github.com/aws/aws-sdk-go/service/rds/rdsiface" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -17,6 +12,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/rds/dbinstance/setup.go b/pkg/controller/rds/dbinstance/setup.go index 8ba6032b03..9be6dd856d 100644 --- a/pkg/controller/rds/dbinstance/setup.go +++ b/pkg/controller/rds/dbinstance/setup.go @@ -11,12 +11,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/rds" svcsdkapi "github.com/aws/aws-sdk-go/service/rds/rdsiface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -25,6 +19,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/password" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -112,7 +111,7 @@ func preObserve(_ context.Context, cr *svcapitypes.DBInstance, obj *svcsdk.Descr return nil } -func (e *custom) preCreate(ctx context.Context, cr *svcapitypes.DBInstance, obj *svcsdk.CreateDBInstanceInput) (err error) { // nolint:gocyclo +func (e *custom) preCreate(ctx context.Context, cr *svcapitypes.DBInstance, obj *svcsdk.CreateDBInstanceInput) (err error) { //nolint:gocyclo restoreFrom := cr.Spec.ForProvider.RestoreFrom autogenerate := cr.Spec.ForProvider.AutogeneratePassword masterUserPasswordSecretRef := cr.Spec.ForProvider.MasterUserPasswordSecretRef @@ -303,7 +302,7 @@ func (e *custom) postObserve(ctx context.Context, cr *svcapitypes.DBInstance, re return obs, err } -func lateInitialize(in *svcapitypes.DBInstanceParameters, out *svcsdk.DescribeDBInstancesOutput) error { // nolint:gocyclo +func lateInitialize(in *svcapitypes.DBInstanceParameters, out *svcsdk.DescribeDBInstancesOutput) error { //nolint:gocyclo // (PocketMobsters): The controller should already be checking if out is nil so we *should* have a dbinstance here, always db := out.DBInstances[0] in.DBInstanceClass = aws.LateInitializeStringPtr(in.DBInstanceClass, db.DBInstanceClass) @@ -393,7 +392,7 @@ func lateInitialize(in *svcapitypes.DBInstanceParameters, out *svcsdk.DescribeDB return nil } -func (e *custom) isUpToDate(ctx context.Context, cr *svcapitypes.DBInstance, out *svcsdk.DescribeDBInstancesOutput) (upToDate bool, diff string, err error) { // nolint:gocyclo +func (e *custom) isUpToDate(ctx context.Context, cr *svcapitypes.DBInstance, out *svcsdk.DescribeDBInstancesOutput) (upToDate bool, diff string, err error) { //nolint:gocyclo db := out.DBInstances[0] patch, err := createPatch(out, &cr.Spec.ForProvider) diff --git a/pkg/controller/rds/dbinstanceroleassociation/setup.go b/pkg/controller/rds/dbinstanceroleassociation/setup.go index e35d611ef5..62e9887229 100644 --- a/pkg/controller/rds/dbinstanceroleassociation/setup.go +++ b/pkg/controller/rds/dbinstanceroleassociation/setup.go @@ -5,15 +5,14 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/rds" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/rds/dbparametergroup/setup.go b/pkg/controller/rds/dbparametergroup/setup.go index 7567765843..e2ff801782 100644 --- a/pkg/controller/rds/dbparametergroup/setup.go +++ b/pkg/controller/rds/dbparametergroup/setup.go @@ -5,10 +5,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/rds" svcsdkapi "github.com/aws/aws-sdk-go/service/rds/rdsiface" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -16,6 +12,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/rds/globalcluster/setup.go b/pkg/controller/rds/globalcluster/setup.go index 192d9e8e0b..3a232ef5c6 100644 --- a/pkg/controller/rds/globalcluster/setup.go +++ b/pkg/controller/rds/globalcluster/setup.go @@ -4,8 +4,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/rds" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -13,6 +11,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/rds/optiongroup/setup.go b/pkg/controller/rds/optiongroup/setup.go index 8272006ca6..e60372d8e5 100644 --- a/pkg/controller/rds/optiongroup/setup.go +++ b/pkg/controller/rds/optiongroup/setup.go @@ -5,9 +5,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/rds" "github.com/aws/aws-sdk-go/service/rds/rdsiface" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -15,6 +12,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -107,7 +106,7 @@ func filterList(cr *svcapitypes.OptionGroup, obj *svcsdk.DescribeOptionGroupsOut return resp } -func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.OptionGroup, obj *svcsdk.DescribeOptionGroupsOutput) (bool, string, error) { // nolint:gocyclo +func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.OptionGroup, obj *svcsdk.DescribeOptionGroupsOutput) (bool, string, error) { if aws.StringValue(cr.Spec.ForProvider.OptionGroupDescription) != aws.StringValue(obj.OptionGroupsList[0].OptionGroupDescription) { return false, "", nil diff --git a/pkg/controller/rds/setup.go b/pkg/controller/rds/setup.go index b24f0edccc..24bbabcd84 100644 --- a/pkg/controller/rds/setup.go +++ b/pkg/controller/rds/setup.go @@ -17,9 +17,8 @@ limitations under the License. package rds import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbcluster" "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/dbclusterparametergroup" diff --git a/pkg/controller/redshift/cluster/controller.go b/pkg/controller/redshift/cluster/controller.go index 1fd1e18ce2..56b6c6d42e 100644 --- a/pkg/controller/redshift/cluster/controller.go +++ b/pkg/controller/redshift/cluster/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsredshift "github.com/aws/aws-sdk-go-v2/service/redshift" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -34,6 +30,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/password" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" redshiftv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/redshift/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -109,7 +108,7 @@ type external struct { client redshift.Client } -func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo +func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { cr, ok := mg.(*redshiftv1alpha1.Cluster) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/redshift/cluster/controller_test.go b/pkg/controller/redshift/cluster/controller_test.go index bdf6db870f..0410545ced 100644 --- a/pkg/controller/redshift/cluster/controller_test.go +++ b/pkg/controller/redshift/cluster/controller_test.go @@ -22,14 +22,13 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsredshift "github.com/aws/aws-sdk-go-v2/service/redshift" awsredshifttypes "github.com/aws/aws-sdk-go-v2/service/redshift/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/redshift/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/redshift/setup.go b/pkg/controller/redshift/setup.go index c913b04f16..b56468ead4 100644 --- a/pkg/controller/redshift/setup.go +++ b/pkg/controller/redshift/setup.go @@ -17,9 +17,8 @@ limitations under the License. package redshift import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/redshift/cluster" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/route53/hostedzone/controller.go b/pkg/controller/route53/hostedzone/controller.go index 593f1098f8..718837f7d2 100644 --- a/pkg/controller/route53/hostedzone/controller.go +++ b/pkg/controller/route53/hostedzone/controller.go @@ -23,11 +23,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/route53" route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +30,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" route53v1alpha1 "github.com/crossplane-contrib/provider-aws/apis/route53/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/route53/hostedzone/controller_test.go b/pkg/controller/route53/hostedzone/controller_test.go index e597f8ce6e..bfafac8804 100644 --- a/pkg/controller/route53/hostedzone/controller_test.go +++ b/pkg/controller/route53/hostedzone/controller_test.go @@ -25,16 +25,15 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awsroute53 "github.com/aws/aws-sdk-go-v2/service/route53" awsroute53types "github.com/aws/aws-sdk-go-v2/service/route53/types" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/route53/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/route53/resourcerecordset/controller.go b/pkg/controller/route53/resourcerecordset/controller.go index b6541425dd..692f89a2df 100644 --- a/pkg/controller/route53/resourcerecordset/controller.go +++ b/pkg/controller/route53/resourcerecordset/controller.go @@ -21,11 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +28,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" route53v1alpha1 "github.com/crossplane-contrib/provider-aws/apis/route53/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/route53/resourcerecordset/controller_test.go b/pkg/controller/route53/resourcerecordset/controller_test.go index 9df06ffdfe..33afa18192 100644 --- a/pkg/controller/route53/resourcerecordset/controller_test.go +++ b/pkg/controller/route53/resourcerecordset/controller_test.go @@ -23,16 +23,15 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" "github.com/aws/aws-sdk-go-v2/service/route53" route53types "github.com/aws/aws-sdk-go-v2/service/route53/types" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/route53/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/route53/setup.go b/pkg/controller/route53/setup.go index fba9dea003..34183b0b08 100644 --- a/pkg/controller/route53/setup.go +++ b/pkg/controller/route53/setup.go @@ -17,9 +17,8 @@ limitations under the License. package route53 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/hostedzone" "github.com/crossplane-contrib/provider-aws/pkg/controller/route53/resourcerecordset" diff --git a/pkg/controller/route53resolver/resolverendpoint/hooks.go b/pkg/controller/route53resolver/resolverendpoint/hooks.go index 4826014228..7da73ca6bb 100644 --- a/pkg/controller/route53resolver/resolverendpoint/hooks.go +++ b/pkg/controller/route53resolver/resolverendpoint/hooks.go @@ -5,8 +5,6 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/route53resolver" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -14,6 +12,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" route53resolverv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" diff --git a/pkg/controller/route53resolver/resolverrule/hooks.go b/pkg/controller/route53resolver/resolverrule/hooks.go index 0c1ebc9e6e..aa6ed73d90 100644 --- a/pkg/controller/route53resolver/resolverrule/hooks.go +++ b/pkg/controller/route53resolver/resolverrule/hooks.go @@ -5,15 +5,14 @@ import ( "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/route53resolver" - "github.com/crossplane/crossplane-runtime/pkg/meta" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + cpresource "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" route53resolverv1alpha1 "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" diff --git a/pkg/controller/route53resolver/resolverruleassociation/hooks.go b/pkg/controller/route53resolver/resolverruleassociation/hooks.go index a558d7ecdd..f0ae3ff1a8 100644 --- a/pkg/controller/route53resolver/resolverruleassociation/hooks.go +++ b/pkg/controller/route53resolver/resolverruleassociation/hooks.go @@ -21,9 +21,6 @@ import ( "errors" "github.com/aws/aws-sdk-go-v2/aws" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -31,6 +28,8 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/route53resolver/manualv1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -120,13 +119,15 @@ func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.Ex return managed.ExternalObservation{}, awsclient.Wrap(resource.Ignore(resolverruleassociation.IsNotFound, err), errGet) } - switch res.ResolverRuleAssociation.Status { // nolint:exhaustive + switch res.ResolverRuleAssociation.Status { case manualv1alpha1.ResolverRuleAssociationStatusComplete: cr.Status.SetConditions(xpv1.Available()) case manualv1alpha1.ResolverRuleAssociationStatusCreating: cr.Status.SetConditions(xpv1.Creating()) case manualv1alpha1.ResolverRuleAssociationStatusDeleting: cr.Status.SetConditions(xpv1.Deleting()) + case manualv1alpha1.ResolverRuleAssociationStatusFailed, manualv1alpha1.ResolverRuleAssociationStatusOverridden: + cr.Status.SetConditions(xpv1.Unavailable()) default: cr.Status.SetConditions(xpv1.Unavailable()) } diff --git a/pkg/controller/route53resolver/setup.go b/pkg/controller/route53resolver/setup.go index d52696eedc..9e21d858df 100644 --- a/pkg/controller/route53resolver/setup.go +++ b/pkg/controller/route53resolver/setup.go @@ -17,9 +17,8 @@ limitations under the License. package route53resolver import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverendpoint" "github.com/crossplane-contrib/provider-aws/pkg/controller/route53resolver/resolverrule" diff --git a/pkg/controller/s3/bucket/CORSConfig.go b/pkg/controller/s3/bucket/CORSConfig.go index 1e01e0c198..e91fc4dcac 100644 --- a/pkg/controller/s3/bucket/CORSConfig.go +++ b/pkg/controller/s3/bucket/CORSConfig.go @@ -130,7 +130,7 @@ func GeneratePutBucketCorsInput(name string, config *v1beta1.CORSConfiguration) } // CompareCORS compares the external and internal representations for the list of CORSRules -func CompareCORS(local []v1beta1.CORSRule, external []types.CORSRule) ResourceStatus { // nolint:gocyclo +func CompareCORS(local []v1beta1.CORSRule, external []types.CORSRule) ResourceStatus { //nolint:gocyclo switch { case len(local) == 0 && len(external) != 0: return NeedsDeletion diff --git a/pkg/controller/s3/bucket/bucket.go b/pkg/controller/s3/bucket/bucket.go index 5ef59d720f..f71f035689 100644 --- a/pkg/controller/s3/bucket/bucket.go +++ b/pkg/controller/s3/bucket/bucket.go @@ -21,12 +21,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awss3 "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - k8serrors "k8s.io/apimachinery/pkg/util/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -35,6 +29,11 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + k8serrors "k8s.io/apimachinery/pkg/util/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -112,7 +111,7 @@ type external struct { subresourceClients []SubresourceClient } -func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { // nolint: gocyclo +func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { //nolint: gocyclo cr, ok := mg.(*v1beta1.Bucket) if !ok { return managed.ExternalObservation{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/s3/bucket/bucket_test.go b/pkg/controller/s3/bucket/bucket_test.go index e6d816a79b..88e437b77f 100644 --- a/pkg/controller/s3/bucket/bucket_test.go +++ b/pkg/controller/s3/bucket/bucket_test.go @@ -25,16 +25,15 @@ import ( awss3 "github.com/aws/aws-sdk-go-v2/service/s3" awss3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - k8serrors "k8s.io/apimachinery/pkg/util/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/logging" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + k8serrors "k8s.io/apimachinery/pkg/util/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/s3/bucket/lifecycleConfig.go b/pkg/controller/s3/bucket/lifecycleConfig.go index 196a325e1b..81450f4c72 100644 --- a/pkg/controller/s3/bucket/lifecycleConfig.go +++ b/pkg/controller/s3/bucket/lifecycleConfig.go @@ -19,15 +19,15 @@ package bucket import ( "context" - "github.com/aws/smithy-go/document" - "github.com/aws/aws-sdk-go-v2/aws" awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/document" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" + "k8s.io/utils/ptr" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -145,10 +145,10 @@ func GenerateLifecycleConfiguration(name string, config *v1beta1.BucketLifecycle } // GenerateLifecycleRules creates the list of LifecycleRules for the AWS SDK -func GenerateLifecycleRules(in []v1beta1.LifecycleRule) []types.LifecycleRule { // nolint:gocyclo +func GenerateLifecycleRules(in []v1beta1.LifecycleRule) []types.LifecycleRule { //nolint:gocyclo // NOTE(muvaf): prealloc is disabled due to AWS requiring nil instead // of 0-length for empty slices. - var result []types.LifecycleRule // nolint:prealloc + var result []types.LifecycleRule //nolint:prealloc for _, local := range in { rule := types.LifecycleRule{ ID: local.ID, @@ -165,7 +165,7 @@ func GenerateLifecycleRules(in []v1beta1.LifecycleRule) []types.LifecycleRule { ExpiredObjectDeleteMarker: local.Expiration.ExpiredObjectDeleteMarker, } if local.Expiration.Date != nil { - rule.Expiration.Date = &local.Expiration.Date.Time + rule.Expiration.Date = ptr.To(local.Expiration.Date.Time) } } if local.NoncurrentVersionExpiration != nil { @@ -188,7 +188,7 @@ func GenerateLifecycleRules(in []v1beta1.LifecycleRule) []types.LifecycleRule { StorageClass: types.TransitionStorageClass(transition.StorageClass), } if transition.Date != nil { - rule.Transitions[tIndex].Date = &transition.Date.Time + rule.Transitions[tIndex].Date = ptr.To(transition.Date.Time) } } } @@ -225,7 +225,7 @@ func sortFilterTags(rules []types.LifecycleRule) { } } -func createLifecycleRulesFromExternal(external []types.LifecycleRule, config *v1beta1.BucketLifecycleConfiguration) { // nolint:gocyclo +func createLifecycleRulesFromExternal(external []types.LifecycleRule, config *v1beta1.BucketLifecycleConfiguration) { //nolint:gocyclo if config.Rules != nil { return } diff --git a/pkg/controller/s3/bucket/lifecycleConfig_test.go b/pkg/controller/s3/bucket/lifecycleConfig_test.go index 58fbd1f843..20d87d36b7 100644 --- a/pkg/controller/s3/bucket/lifecycleConfig_test.go +++ b/pkg/controller/s3/bucket/lifecycleConfig_test.go @@ -21,14 +21,13 @@ import ( "testing" "time" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/service/s3" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go" + "github.com/aws/smithy-go/document" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" diff --git a/pkg/controller/s3/bucket/loggingConfig.go b/pkg/controller/s3/bucket/loggingConfig.go index 9681952624..bc8d42362d 100644 --- a/pkg/controller/s3/bucket/loggingConfig.go +++ b/pkg/controller/s3/bucket/loggingConfig.go @@ -19,10 +19,9 @@ package bucket import ( "context" - "github.com/aws/smithy-go/document" - awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/document" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/google/go-cmp/cmp" diff --git a/pkg/controller/s3/bucket/notificationConfig.go b/pkg/controller/s3/bucket/notificationConfig.go index fc64a77543..3a909802ef 100644 --- a/pkg/controller/s3/bucket/notificationConfig.go +++ b/pkg/controller/s3/bucket/notificationConfig.go @@ -21,16 +21,14 @@ import ( "sort" "strings" - "github.com/barkimedes/go-deepcopy" - - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - "github.com/aws/aws-sdk-go-v2/aws" awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/document" + "github.com/barkimedes/go-deepcopy" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -63,7 +61,7 @@ func (in *NotificationConfigurationClient) Observe(ctx context.Context, bucket * } // IsNotificationConfigurationUpToDate determines whether a notification configuration needs to be updated -func IsNotificationConfigurationUpToDate(cr *v1beta1.NotificationConfiguration, external *awss3.GetBucketNotificationConfigurationOutput) (ResourceStatus, error) { // nolint:gocyclo +func IsNotificationConfigurationUpToDate(cr *v1beta1.NotificationConfiguration, external *awss3.GetBucketNotificationConfigurationOutput) (ResourceStatus, error) { //nolint:gocyclo // Note - aws API treats nil configuration different than empty configuration // As such, we can't prealloc this due to the API // If no configuration is defined but there is one in aws, we must delete it @@ -165,7 +163,7 @@ func sanitizedQueueConfigurations(configs []types.QueueConfiguration) []types.Qu func GenerateLambdaConfiguration(config *v1beta1.NotificationConfiguration) []types.LambdaFunctionConfiguration { // NOTE(muvaf): We skip prealloc because the behavior of AWS SDK differs when // the array is 0 element vs nil. - var configurations []types.LambdaFunctionConfiguration // nolint:prealloc + var configurations []types.LambdaFunctionConfiguration //nolint:prealloc for _, v := range config.LambdaFunctionConfigurations { conf := types.LambdaFunctionConfiguration{ Filter: nil, @@ -187,7 +185,7 @@ func GenerateLambdaConfiguration(config *v1beta1.NotificationConfiguration) []ty func GenerateTopicConfigurations(config *v1beta1.NotificationConfiguration) []types.TopicConfiguration { // NOTE(muvaf): We skip prealloc because the behavior of AWS SDK differs when // the array is 0 element vs nil. - var configurations []types.TopicConfiguration // nolint:prealloc + var configurations []types.TopicConfiguration //nolint:prealloc for _, v := range config.TopicConfigurations { conf := types.TopicConfiguration{ Id: v.ID, @@ -208,7 +206,7 @@ func GenerateTopicConfigurations(config *v1beta1.NotificationConfiguration) []ty func GenerateQueueConfigurations(config *v1beta1.NotificationConfiguration) []types.QueueConfiguration { // NOTE(muvaf): We skip prealloc because the behavior of AWS SDK differs when // the array is 0 element vs nil. - var configurations []types.QueueConfiguration // nolint:prealloc + var configurations []types.QueueConfiguration //nolint:prealloc for _, v := range config.QueueConfigurations { conf := types.QueueConfiguration{ Id: v.ID, diff --git a/pkg/controller/s3/bucket/notificationConfig_test.go b/pkg/controller/s3/bucket/notificationConfig_test.go index f82646c977..7407587ff1 100644 --- a/pkg/controller/s3/bucket/notificationConfig_test.go +++ b/pkg/controller/s3/bucket/notificationConfig_test.go @@ -21,12 +21,11 @@ import ( "testing" "github.com/aws/aws-sdk-go-v2/service/s3" + "github.com/aws/aws-sdk-go-v2/service/s3/types" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" - "github.com/aws/aws-sdk-go-v2/service/s3/types" - "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/s3/fake" diff --git a/pkg/controller/s3/bucket/policy.go b/pkg/controller/s3/bucket/policy.go index 46c282f1c3..1d4de6b21c 100644 --- a/pkg/controller/s3/bucket/policy.go +++ b/pkg/controller/s3/bucket/policy.go @@ -20,9 +20,8 @@ import ( "context" awss3 "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -47,7 +46,7 @@ func NewPolicyClient(client s3.BucketPolicyClient) *PolicyClient { } // Observe checks if the resource exists and if it matches the local configuration -func (e *PolicyClient) Observe(ctx context.Context, cr *v1beta1.Bucket) (ResourceStatus, error) { //nolint:gocyclo +func (e *PolicyClient) Observe(ctx context.Context, cr *v1beta1.Bucket) (ResourceStatus, error) { resp, err := e.client.GetBucketPolicy(ctx, &awss3.GetBucketPolicyInput{ Bucket: awsclient.String(meta.GetExternalName(cr)), }) diff --git a/pkg/controller/s3/bucket/publicAccessBlock.go b/pkg/controller/s3/bucket/publicAccessBlock.go index de06de85b9..aeb181fb7e 100644 --- a/pkg/controller/s3/bucket/publicAccessBlock.go +++ b/pkg/controller/s3/bucket/publicAccessBlock.go @@ -21,10 +21,9 @@ import ( awss3 "github.com/aws/aws-sdk-go-v2/service/s3" awss3types "github.com/aws/aws-sdk-go-v2/service/s3/types" - "github.com/pkg/errors" - "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/s3/bucket/publicAccessBlock_test.go b/pkg/controller/s3/bucket/publicAccessBlock_test.go index 8182d55f2b..3d3d578862 100644 --- a/pkg/controller/s3/bucket/publicAccessBlock_test.go +++ b/pkg/controller/s3/bucket/publicAccessBlock_test.go @@ -7,9 +7,8 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3" s3types "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/s3/bucket/replicationConfig.go b/pkg/controller/s3/bucket/replicationConfig.go index b851b444c1..94efb1587b 100644 --- a/pkg/controller/s3/bucket/replicationConfig.go +++ b/pkg/controller/s3/bucket/replicationConfig.go @@ -51,7 +51,7 @@ func NewReplicationConfigurationClient(client s3.BucketClient) *ReplicationConfi } // Observe checks if the resource exists and if it matches the local configuration -func (in *ReplicationConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { // nolint:gocyclo +func (in *ReplicationConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { //nolint:gocyclo external, err := in.client.GetBucketReplication(ctx, &awss3.GetBucketReplicationInput{Bucket: awsclient.String(meta.GetExternalName(bucket))}) config := bucket.Spec.ForProvider.ReplicationConfiguration if err != nil { @@ -133,7 +133,7 @@ func (in *ReplicationConfigurationClient) SubresourceExists(bucket *v1beta1.Buck return bucket.Spec.ForProvider.ReplicationConfiguration != nil } -func createReplicationRulesFromExternal(external *types.ReplicationConfiguration, config *v1beta1.ReplicationConfiguration) { // nolint:gocyclo +func createReplicationRulesFromExternal(external *types.ReplicationConfiguration, config *v1beta1.ReplicationConfiguration) { //nolint:gocyclo if config.Rules != nil { return } diff --git a/pkg/controller/s3/bucket/sseConfig.go b/pkg/controller/s3/bucket/sseConfig.go index b804081860..ccf5566dfa 100644 --- a/pkg/controller/s3/bucket/sseConfig.go +++ b/pkg/controller/s3/bucket/sseConfig.go @@ -46,7 +46,7 @@ func NewSSEConfigurationClient(client s3.BucketClient) *SSEConfigurationClient { } // Observe checks if the resource exists and if it matches the local configuration -func (in *SSEConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { // nolint:gocyclo +func (in *SSEConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { //nolint:gocyclo config := bucket.Spec.ForProvider.ServerSideEncryptionConfiguration external, err := in.client.GetBucketEncryption(ctx, &awss3.GetBucketEncryptionInput{Bucket: awsclient.String(meta.GetExternalName(bucket))}) if err != nil { diff --git a/pkg/controller/s3/bucket/taggingConfig.go b/pkg/controller/s3/bucket/taggingConfig.go index 5e6fd5d872..af8bcd6bef 100644 --- a/pkg/controller/s3/bucket/taggingConfig.go +++ b/pkg/controller/s3/bucket/taggingConfig.go @@ -19,14 +19,13 @@ package bucket import ( "context" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/document" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/s3/bucket/versioningConfig.go b/pkg/controller/s3/bucket/versioningConfig.go index c331dbc79f..1cf8c6af8f 100644 --- a/pkg/controller/s3/bucket/versioningConfig.go +++ b/pkg/controller/s3/bucket/versioningConfig.go @@ -44,7 +44,7 @@ func NewVersioningConfigurationClient(client s3.BucketClient) *VersioningConfigu } // Observe checks if the resource exists and if it matches the local configuration -func (in *VersioningConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { // nolint:gocyclo +func (in *VersioningConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { external, err := in.client.GetBucketVersioning(ctx, &awss3.GetBucketVersioningInput{Bucket: awsclient.String(meta.GetExternalName(bucket))}) if err != nil { return NeedsUpdate, awsclient.Wrap(err, versioningGetFailed) diff --git a/pkg/controller/s3/bucket/websiteConfig.go b/pkg/controller/s3/bucket/websiteConfig.go index 9370a056ce..e380ff962b 100644 --- a/pkg/controller/s3/bucket/websiteConfig.go +++ b/pkg/controller/s3/bucket/websiteConfig.go @@ -19,14 +19,13 @@ package bucket import ( "context" - "github.com/aws/smithy-go/document" - "github.com/google/go-cmp/cmp/cmpopts" - awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/aws-sdk-go-v2/service/s3/types" + "github.com/aws/smithy-go/document" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" "github.com/crossplane-contrib/provider-aws/apis/s3/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" @@ -50,7 +49,7 @@ func NewWebsiteConfigurationClient(client s3.BucketClient) *WebsiteConfiguration } // Observe checks if the resource exists and if it matches the local configuration -func (in *WebsiteConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { // nolint:gocyclo +func (in *WebsiteConfigurationClient) Observe(ctx context.Context, bucket *v1beta1.Bucket) (ResourceStatus, error) { //nolint:gocyclo external, err := in.client.GetBucketWebsite(ctx, &awss3.GetBucketWebsiteInput{Bucket: awsclient.String(meta.GetExternalName(bucket))}) config := bucket.Spec.ForProvider.WebsiteConfiguration if err != nil { @@ -180,7 +179,7 @@ func GeneratePutBucketWebsiteInput(name string, config *v1beta1.WebsiteConfigura return wi } -func createWebsiteConfigFromExternal(external *awss3.GetBucketWebsiteOutput, config *v1beta1.WebsiteConfiguration) { // nolint:gocyclo +func createWebsiteConfigFromExternal(external *awss3.GetBucketWebsiteOutput, config *v1beta1.WebsiteConfiguration) { //nolint:gocyclo if external.ErrorDocument != nil { if config.ErrorDocument == nil { config.ErrorDocument = &v1beta1.ErrorDocument{} diff --git a/pkg/controller/s3/bucketpolicy/bucketpolicy.go b/pkg/controller/s3/bucketpolicy/bucketpolicy.go index ae58adc53f..10f3ec2362 100644 --- a/pkg/controller/s3/bucketpolicy/bucketpolicy.go +++ b/pkg/controller/s3/bucketpolicy/bucketpolicy.go @@ -22,17 +22,16 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awss3 "github.com/aws/aws-sdk-go-v2/service/s3" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/s3/v1alpha3" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/s3/bucketpolicy/bucketpolicy_test.go b/pkg/controller/s3/bucketpolicy/bucketpolicy_test.go index 1aa5ea594c..6c41065e1c 100644 --- a/pkg/controller/s3/bucketpolicy/bucketpolicy_test.go +++ b/pkg/controller/s3/bucketpolicy/bucketpolicy_test.go @@ -22,13 +22,12 @@ import ( awss3 "github.com/aws/aws-sdk-go-v2/service/s3" "github.com/aws/smithy-go" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" "github.com/crossplane-contrib/provider-aws/apis/s3/common" "github.com/crossplane-contrib/provider-aws/apis/s3/v1alpha3" diff --git a/pkg/controller/s3/setup.go b/pkg/controller/s3/setup.go index 5817a9872c..044601c7a2 100644 --- a/pkg/controller/s3/setup.go +++ b/pkg/controller/s3/setup.go @@ -17,9 +17,8 @@ limitations under the License. package s3 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucket" "github.com/crossplane-contrib/provider-aws/pkg/controller/s3/bucketpolicy" diff --git a/pkg/controller/s3/testing/testHelper.go b/pkg/controller/s3/testing/testHelper.go index 495d09cbf4..75b923fb48 100644 --- a/pkg/controller/s3/testing/testHelper.go +++ b/pkg/controller/s3/testing/testHelper.go @@ -50,72 +50,72 @@ func WithArn(arn string) BucketModifier { } // WithConditions sets the Conditions for an S3 Bucket -func WithConditions(c ...xpv1.Condition) BucketModifier { //nolint +func WithConditions(c ...xpv1.Condition) BucketModifier { return func(r *v1beta1.Bucket) { r.Status.ConditionedStatus.Conditions = c } } // WithAccelerationConfig sets the AccelerateConfiguration for an S3 Bucket -func WithAccelerationConfig(s *v1beta1.AccelerateConfiguration) BucketModifier { //nolint +func WithAccelerationConfig(s *v1beta1.AccelerateConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.AccelerateConfiguration = s } } // WithSSEConfig sets the ServerSideEncryptionConfiguration for an S3 Bucket -func WithSSEConfig(s *v1beta1.ServerSideEncryptionConfiguration) BucketModifier { //nolint +func WithSSEConfig(s *v1beta1.ServerSideEncryptionConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.ServerSideEncryptionConfiguration = s } } // WithVersioningConfig sets the VersioningConfiguration for an S3 Bucket -func WithVersioningConfig(s *v1beta1.VersioningConfiguration) BucketModifier { //nolint +func WithVersioningConfig(s *v1beta1.VersioningConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.VersioningConfiguration = s } } // WithCORSConfig sets the CORSConfiguration for an S3 Bucket -func WithCORSConfig(s *v1beta1.CORSConfiguration) BucketModifier { //nolint +func WithCORSConfig(s *v1beta1.CORSConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.CORSConfiguration = s } } // WithWebConfig sets the WebsiteConfiguration for an S3 Bucket -func WithWebConfig(s *v1beta1.WebsiteConfiguration) BucketModifier { //nolint +func WithWebConfig(s *v1beta1.WebsiteConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.WebsiteConfiguration = s } } // WithLoggingConfig sets the LoggingConfiguration for an S3 Bucket -func WithLoggingConfig(s *v1beta1.LoggingConfiguration) BucketModifier { //nolint +func WithLoggingConfig(s *v1beta1.LoggingConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.LoggingConfiguration = s } } // WithPayerConfig sets the PaymentConfiguration for an S3 Bucket -func WithPayerConfig(s *v1beta1.PaymentConfiguration) BucketModifier { //nolint +func WithPayerConfig(s *v1beta1.PaymentConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.PayerConfiguration = s } } // WithTaggingConfig sets the Tagging for an S3 Bucket -func WithTaggingConfig(s *v1beta1.Tagging) BucketModifier { //nolint +func WithTaggingConfig(s *v1beta1.Tagging) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.BucketTagging = s } } // WithReplConfig sets the ReplicationConfiguration for an S3 Bucket -func WithReplConfig(s *v1beta1.ReplicationConfiguration) BucketModifier { //nolint +func WithReplConfig(s *v1beta1.ReplicationConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.ReplicationConfiguration = s } } // WithLifecycleConfig sets the BucketLifecycleConfiguration for an S3 Bucket -func WithLifecycleConfig(s *v1beta1.BucketLifecycleConfiguration) BucketModifier { //nolint +func WithLifecycleConfig(s *v1beta1.BucketLifecycleConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.LifecycleConfiguration = s } } // WithNotificationConfig sets the NotificationConfiguration for an S3 Bucket -func WithNotificationConfig(s *v1beta1.NotificationConfiguration) BucketModifier { //nolint +func WithNotificationConfig(s *v1beta1.NotificationConfiguration) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.NotificationConfiguration = s } } // WithPolicy sets the policy for an S3 Bucket -func WithPolicy(s *common.BucketPolicyBody) BucketModifier { // nolint +func WithPolicy(s *common.BucketPolicyBody) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.Policy = s } } // WithPolicyUpdatePolicy sets BucketPolicyUpdatePolicy for an S3 Bucket. -func WithPolicyUpdatePolicy(s *v1beta1.BucketPolicyUpdatePolicy) BucketModifier { // nolint +func WithPolicyUpdatePolicy(s *v1beta1.BucketPolicyUpdatePolicy) BucketModifier { return func(r *v1beta1.Bucket) { r.Spec.ForProvider.PolicyUpdatePolicy = s } } diff --git a/pkg/controller/s3control/accesspoint/policy.go b/pkg/controller/s3control/accesspoint/policy.go index 6ec8a71440..2652c4633b 100644 --- a/pkg/controller/s3control/accesspoint/policy.go +++ b/pkg/controller/s3control/accesspoint/policy.go @@ -110,7 +110,7 @@ func (p *policyClient) delete(ctx context.Context, cr *svcapitypes.AccessPoint) // isErrorPolicyNotFound returns whether the given error is of type NotFound or not. func isErrorPolicyNotFound(err error) bool { - awsErr, ok := err.(awserr.Error) //nolint + awsErr, ok := err.(awserr.Error) //nolint:errorlint return ok && awsErr.Code() == "NoSuchAccessPointPolicy" } diff --git a/pkg/controller/s3control/setup.go b/pkg/controller/s3control/setup.go index 24d66b1319..07d2691e22 100644 --- a/pkg/controller/s3control/setup.go +++ b/pkg/controller/s3control/setup.go @@ -17,9 +17,8 @@ limitations under the License. package s3control import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/s3control/accesspoint" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/s3control/testing/testHelper.go b/pkg/controller/s3control/testing/testHelper.go index f45ed6f6b4..956d7f89d7 100644 --- a/pkg/controller/s3control/testing/testHelper.go +++ b/pkg/controller/s3control/testing/testHelper.go @@ -19,7 +19,7 @@ func WithConditions(c ...xpv1.Condition) AccessPointModifier { } // WithPolicy sets the policy for an AccessPoint -func WithPolicy(s *common.BucketPolicyBody) AccessPointModifier { // nolint +func WithPolicy(s *common.BucketPolicyBody) AccessPointModifier { return func(r *svcapitypes.AccessPoint) { r.Spec.ForProvider.Policy = s } } diff --git a/pkg/controller/secretsmanager/secret/setup.go b/pkg/controller/secretsmanager/secret/setup.go index 3132d34023..feb2e1ebfa 100644 --- a/pkg/controller/secretsmanager/secret/setup.go +++ b/pkg/controller/secretsmanager/secret/setup.go @@ -22,14 +22,6 @@ import ( svcsdk "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface" - "github.com/pkg/errors" - corev1 "k8s.io/api/core/v1" - kerrors "k8s.io/apimachinery/pkg/api/errors" - metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -37,6 +29,13 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + kerrors "k8s.io/apimachinery/pkg/api/errors" + metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/secretsmanager/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -195,7 +194,7 @@ func (e *hooks) lateInitialize(spec *svcapitypes.SecretParameters, resp *svcsdk. return errors.Wrap(e.kube.Create(context.TODO(), sc), errCreateK8sSecret) } -func getAWSSecretData(ref *svcapitypes.SecretReference, s *svcsdk.GetSecretValueOutput) (map[string][]byte, error) { // nolint:gocyclo +func getAWSSecretData(ref *svcapitypes.SecretReference, s *svcsdk.GetSecretValueOutput) (map[string][]byte, error) { if ref.Key != nil { switch { case awsclients.StringValue(s.SecretString) != "": @@ -235,7 +234,7 @@ func getAWSSecretData(ref *svcapitypes.SecretReference, s *svcsdk.GetSecretValue return payload, nil } -func (e *hooks) isUpToDate(ctx context.Context, cr *svcapitypes.Secret, resp *svcsdk.DescribeSecretOutput) (bool, string, error) { // nolint:gocyclo +func (e *hooks) isUpToDate(ctx context.Context, cr *svcapitypes.Secret, resp *svcsdk.DescribeSecretOutput) (bool, string, error) { if meta.WasDeleted(cr) { return false, "", nil } @@ -356,7 +355,7 @@ func getSecretRef(params *svcapitypes.SecretParameters) (*svcapitypes.SecretRefe return nil, errors.New(errNoSecretRef) } -func (e *hooks) preUpdate(ctx context.Context, cr *svcapitypes.Secret, obj *svcsdk.UpdateSecretInput) error { // nolint:gocyclo +func (e *hooks) preUpdate(ctx context.Context, cr *svcapitypes.Secret, obj *svcsdk.UpdateSecretInput) error { //nolint:gocyclo resp, err := e.client.DescribeSecretWithContext(ctx, &svcsdk.DescribeSecretInput{ SecretId: awsclients.String(meta.GetExternalName(cr)), }) diff --git a/pkg/controller/secretsmanager/secret/setup_test.go b/pkg/controller/secretsmanager/secret/setup_test.go index 528c6ff5e8..7c6d1a0100 100644 --- a/pkg/controller/secretsmanager/secret/setup_test.go +++ b/pkg/controller/secretsmanager/secret/setup_test.go @@ -24,14 +24,13 @@ import ( "github.com/aws/aws-sdk-go/service/secretsmanager" "github.com/aws/aws-sdk-go/service/secretsmanager/secretsmanageriface" - "github.com/google/go-cmp/cmp" - corev1 "k8s.io/api/core/v1" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + corev1 "k8s.io/api/core/v1" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/secretsmanager/v1beta1" "github.com/crossplane-contrib/provider-aws/pkg/clients/secretsmanager/fake" diff --git a/pkg/controller/secretsmanager/setup.go b/pkg/controller/secretsmanager/setup.go index 11cd3422cc..e6f34c4e05 100644 --- a/pkg/controller/secretsmanager/setup.go +++ b/pkg/controller/secretsmanager/setup.go @@ -17,9 +17,8 @@ limitations under the License. package secretsmanager import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/secretsmanager/secret" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/servicediscovery/commonnamespace/hooks.go b/pkg/controller/servicediscovery/commonnamespace/hooks.go index b8fc180840..e04f0807da 100644 --- a/pkg/controller/servicediscovery/commonnamespace/hooks.go +++ b/pkg/controller/servicediscovery/commonnamespace/hooks.go @@ -70,7 +70,7 @@ type Hooks struct { } // Observe observes any of HTTPNamespace, PrivateDNSNamespace or PublicDNSNamespace types. -func (h *Hooks) Observe(ctx context.Context, mg cpresource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (h *Hooks) Observe(ctx context.Context, mg cpresource.Managed) (managed.ExternalObservation, error) { //nolint:gocyclo var cr namespace switch i := mg.(type) { case *v1alpha1.HTTPNamespace: diff --git a/pkg/controller/servicediscovery/commonnamespace/hooks_test.go b/pkg/controller/servicediscovery/commonnamespace/hooks_test.go index 5c325e9385..89d87f6ab1 100644 --- a/pkg/controller/servicediscovery/commonnamespace/hooks_test.go +++ b/pkg/controller/servicediscovery/commonnamespace/hooks_test.go @@ -20,19 +20,17 @@ import ( "context" "testing" - "github.com/aws/aws-sdk-go/service/servicediscovery/servicediscoveryiface" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" + "github.com/aws/aws-sdk-go/service/servicediscovery/servicediscoveryiface" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" + "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" + "github.com/crossplane/crossplane-runtime/pkg/test" "github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp/cmpopts" v1 "k8s.io/apimachinery/pkg/apis/meta/v1" "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" - "github.com/crossplane/crossplane-runtime/pkg/test" - "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/servicediscovery/httpnamespace/setup.go b/pkg/controller/servicediscovery/httpnamespace/setup.go index 79d130a4e6..7dbc15752f 100644 --- a/pkg/controller/servicediscovery/httpnamespace/setup.go +++ b/pkg/controller/servicediscovery/httpnamespace/setup.go @@ -19,17 +19,15 @@ package httpnamespace import ( "context" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" - svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" - ctrl "sigs.k8s.io/controller-runtime" - + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/servicediscovery/privatednsnamespace/setup.go b/pkg/controller/servicediscovery/privatednsnamespace/setup.go index f06cc8e54e..27169a423b 100644 --- a/pkg/controller/servicediscovery/privatednsnamespace/setup.go +++ b/pkg/controller/servicediscovery/privatednsnamespace/setup.go @@ -19,18 +19,15 @@ package privatednsnamespace import ( "context" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" - svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" - - ctrl "sigs.k8s.io/controller-runtime" - + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/servicediscovery/publicdnsnamespace/setup.go b/pkg/controller/servicediscovery/publicdnsnamespace/setup.go index 6786272c98..e9c06174dd 100644 --- a/pkg/controller/servicediscovery/publicdnsnamespace/setup.go +++ b/pkg/controller/servicediscovery/publicdnsnamespace/setup.go @@ -19,17 +19,15 @@ package publicdnsnamespace import ( "context" - v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/meta" - svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" - ctrl "sigs.k8s.io/controller-runtime" - + v1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" + "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/servicediscovery/service/setup.go b/pkg/controller/servicediscovery/service/setup.go index af5a1dd3b5..0a539b1d66 100644 --- a/pkg/controller/servicediscovery/service/setup.go +++ b/pkg/controller/servicediscovery/service/setup.go @@ -20,6 +20,10 @@ import ( "context" "strings" + "github.com/aws/aws-sdk-go/aws" + svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" + "github.com/aws/aws-sdk-go/service/servicediscovery/servicediscoveryiface" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" @@ -29,12 +33,6 @@ import ( "github.com/pkg/errors" ctrl "sigs.k8s.io/controller-runtime" - "github.com/aws/aws-sdk-go/aws" - svcsdk "github.com/aws/aws-sdk-go/service/servicediscovery" - "github.com/aws/aws-sdk-go/service/servicediscovery/servicediscoveryiface" - - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - svcapitypes "github.com/crossplane-contrib/provider-aws/apis/servicediscovery/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" clientsvcdk "github.com/crossplane-contrib/provider-aws/pkg/clients/servicediscovery" diff --git a/pkg/controller/servicediscovery/setup.go b/pkg/controller/servicediscovery/setup.go index 3a2296f44c..a17f846a0d 100644 --- a/pkg/controller/servicediscovery/setup.go +++ b/pkg/controller/servicediscovery/setup.go @@ -17,9 +17,8 @@ limitations under the License. package servicediscovery import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/httpnamespace" "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/privatednsnamespace" diff --git a/pkg/controller/sesv2/configurationset/setup.go b/pkg/controller/sesv2/configurationset/setup.go index f50ef862f6..7df1cd6296 100644 --- a/pkg/controller/sesv2/configurationset/setup.go +++ b/pkg/controller/sesv2/configurationset/setup.go @@ -19,27 +19,24 @@ package configurationset import ( "context" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - "github.com/aws/aws-sdk-go/aws" svcsdk "github.com/aws/aws-sdk-go/service/sesv2" "github.com/aws/aws-sdk-go/service/sesv2/sesv2iface" - "github.com/google/go-cmp/cmp" - "github.com/google/go-cmp/cmp/cmpopts" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/google/go-cmp/cmp/cmpopts" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" - - "github.com/pkg/errors" ) const ( @@ -220,7 +217,7 @@ func preDelete(_ context.Context, cr *svcapitypes.ConfigurationSet, obj *svcsdk. return false, nil } -func (e *hooks) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *hooks) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo cr, ok := mg.(*svcapitypes.ConfigurationSet) if !ok { return managed.ExternalUpdate{}, errors.New(errUnexpectedObject) diff --git a/pkg/controller/sesv2/emailidentity/setup.go b/pkg/controller/sesv2/emailidentity/setup.go index 7d825b9f53..99283930af 100644 --- a/pkg/controller/sesv2/emailidentity/setup.go +++ b/pkg/controller/sesv2/emailidentity/setup.go @@ -20,26 +20,23 @@ import ( "context" "encoding/base64" - corev1 "k8s.io/api/core/v1" - "k8s.io/apimachinery/pkg/types" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - svcsdk "github.com/aws/aws-sdk-go/service/sesv2" "github.com/aws/aws-sdk-go/service/sesv2/sesv2iface" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + corev1 "k8s.io/api/core/v1" + "k8s.io/apimachinery/pkg/types" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" - - "github.com/pkg/errors" ) const ( @@ -81,7 +78,7 @@ type hooks struct { kube client.Client } -func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.EmailIdentity, resp *svcsdk.GetEmailIdentityOutput) (bool, string, error) { // nolint:gocyclo +func (e *hooks) isUpToDate(_ context.Context, cr *svcapitypes.EmailIdentity, resp *svcsdk.GetEmailIdentityOutput) (bool, string, error) { //nolint:gocyclo if meta.WasDeleted(cr) { return true, "", nil // There is no need to check for updates when we want to delete. } @@ -153,7 +150,7 @@ func (e *hooks) preCreate(ctx context.Context, cr *svcapitypes.EmailIdentity, ob return nil } -func (e *hooks) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { // nolint:gocyclo +func (e *hooks) update(ctx context.Context, mg resource.Managed) (managed.ExternalUpdate, error) { //nolint:gocyclo // NOTE: Update operation NOT generated by ACK code-generator cr, ok := mg.(*svcapitypes.EmailIdentity) if !ok { diff --git a/pkg/controller/sesv2/emailtemplate/setup.go b/pkg/controller/sesv2/emailtemplate/setup.go index 89311a48e7..5c25c403a1 100644 --- a/pkg/controller/sesv2/emailtemplate/setup.go +++ b/pkg/controller/sesv2/emailtemplate/setup.go @@ -19,16 +19,14 @@ package emailtemplate import ( "context" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/sesv2" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/sesv2/setup.go b/pkg/controller/sesv2/setup.go index a7ece3f433..ffe5f57123 100644 --- a/pkg/controller/sesv2/setup.go +++ b/pkg/controller/sesv2/setup.go @@ -17,9 +17,8 @@ limitations under the License. package sesv2 import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/configurationset" "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/emailidentity" diff --git a/pkg/controller/sfn/activity/hooks.go b/pkg/controller/sfn/activity/hooks.go index 82c6ab7eca..3bbcc68530 100644 --- a/pkg/controller/sfn/activity/hooks.go +++ b/pkg/controller/sfn/activity/hooks.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/sfn" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sfn/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/sfn/setup.go b/pkg/controller/sfn/setup.go index 1edf2b6d5d..b0aaadeffe 100644 --- a/pkg/controller/sfn/setup.go +++ b/pkg/controller/sfn/setup.go @@ -17,9 +17,8 @@ limitations under the License. package sfn import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/activity" "github.com/crossplane-contrib/provider-aws/pkg/controller/sfn/statemachine" diff --git a/pkg/controller/sfn/statemachine/hooks.go b/pkg/controller/sfn/statemachine/hooks.go index 0820cba19e..9ac641280b 100644 --- a/pkg/controller/sfn/statemachine/hooks.go +++ b/pkg/controller/sfn/statemachine/hooks.go @@ -20,8 +20,6 @@ import ( "context" svcsdk "github.com/aws/aws-sdk-go/service/sfn" - ctrl "sigs.k8s.io/controller-runtime" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -29,6 +27,7 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sfn/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/sns/setup.go b/pkg/controller/sns/setup.go index 4951912a02..ef8f8b8701 100644 --- a/pkg/controller/sns/setup.go +++ b/pkg/controller/sns/setup.go @@ -17,9 +17,8 @@ limitations under the License. package sns import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/subscription" "github.com/crossplane-contrib/provider-aws/pkg/controller/sns/topic" diff --git a/pkg/controller/sns/subscription/controller.go b/pkg/controller/sns/subscription/controller.go index ca27f7d89c..4f4f954c08 100644 --- a/pkg/controller/sns/subscription/controller.go +++ b/pkg/controller/sns/subscription/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awssns "github.com/aws/aws-sdk-go-v2/service/sns" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/sns/subscription/controller_test.go b/pkg/controller/sns/subscription/controller_test.go index b33629ed34..478e468d0f 100644 --- a/pkg/controller/sns/subscription/controller_test.go +++ b/pkg/controller/sns/subscription/controller_test.go @@ -5,19 +5,17 @@ import ( "fmt" "testing" - "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" awssns "github.com/aws/aws-sdk-go-v2/service/sns" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/sns" "github.com/crossplane-contrib/provider-aws/pkg/clients/sns/fake" diff --git a/pkg/controller/sns/topic/controller.go b/pkg/controller/sns/topic/controller.go index 5137725f77..5f30d82d33 100644 --- a/pkg/controller/sns/topic/controller.go +++ b/pkg/controller/sns/topic/controller.go @@ -22,10 +22,6 @@ import ( "github.com/aws/aws-sdk-go-v2/aws" awssns "github.com/aws/aws-sdk-go-v2/service/sns" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" "github.com/crossplane/crossplane-runtime/pkg/controller" @@ -33,6 +29,9 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/sns/topic/controller_test.go b/pkg/controller/sns/topic/controller_test.go index ef2c5c13f8..73ef6eb534 100644 --- a/pkg/controller/sns/topic/controller_test.go +++ b/pkg/controller/sns/topic/controller_test.go @@ -21,20 +21,18 @@ import ( "fmt" "testing" - "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" - "github.com/aws/aws-sdk-go-v2/aws" awssns "github.com/aws/aws-sdk-go-v2/service/sns" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" + "github.com/crossplane-contrib/provider-aws/apis/sns/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" "github.com/crossplane-contrib/provider-aws/pkg/clients/sns" "github.com/crossplane-contrib/provider-aws/pkg/clients/sns/fake" diff --git a/pkg/controller/sqs/queue/controller.go b/pkg/controller/sqs/queue/controller.go index 47cca2a1b6..e6fda85368 100644 --- a/pkg/controller/sqs/queue/controller.go +++ b/pkg/controller/sqs/queue/controller.go @@ -20,11 +20,6 @@ import ( "context" "github.com/aws/aws-sdk-go-v2/aws" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - ctrl "sigs.k8s.io/controller-runtime" - "sigs.k8s.io/controller-runtime/pkg/client" - awssqs "github.com/aws/aws-sdk-go-v2/service/sqs" awssqstypes "github.com/aws/aws-sdk-go-v2/service/sqs/types" xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" @@ -34,6 +29,10 @@ import ( "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + ctrl "sigs.k8s.io/controller-runtime" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/sqs/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" @@ -109,7 +108,7 @@ type external struct { kube client.Client } -func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { // nolint:gocyclo +func (e *external) Observe(ctx context.Context, mg resource.Managed) (managed.ExternalObservation, error) { cr, ok := mg.(*v1beta1.Queue) if !ok { return managed.ExternalObservation{}, errors.New(errNotQueue) diff --git a/pkg/controller/sqs/queue/controller_test.go b/pkg/controller/sqs/queue/controller_test.go index fafd3fd8d4..ab4a08afb9 100644 --- a/pkg/controller/sqs/queue/controller_test.go +++ b/pkg/controller/sqs/queue/controller_test.go @@ -20,14 +20,13 @@ import ( "testing" awssqs "github.com/aws/aws-sdk-go-v2/service/sqs" - "github.com/google/go-cmp/cmp" - "github.com/pkg/errors" - "sigs.k8s.io/controller-runtime/pkg/client" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/test" + "github.com/google/go-cmp/cmp" + "github.com/pkg/errors" + "sigs.k8s.io/controller-runtime/pkg/client" "github.com/crossplane-contrib/provider-aws/apis/sqs/v1beta1" awsclient "github.com/crossplane-contrib/provider-aws/pkg/clients" diff --git a/pkg/controller/sqs/setup.go b/pkg/controller/sqs/setup.go index 2e14cceb74..159d56b56e 100644 --- a/pkg/controller/sqs/setup.go +++ b/pkg/controller/sqs/setup.go @@ -17,9 +17,8 @@ limitations under the License. package sqs import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/sqs/queue" "github.com/crossplane-contrib/provider-aws/pkg/utils/setup" diff --git a/pkg/controller/transfer/server/setup.go b/pkg/controller/transfer/server/setup.go index 59a899e551..2c894d04f5 100644 --- a/pkg/controller/transfer/server/setup.go +++ b/pkg/controller/transfer/server/setup.go @@ -16,16 +16,15 @@ package server import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/transfer" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/transfer/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/controller/transfer/setup.go b/pkg/controller/transfer/setup.go index c8555b6cb3..1e3fb15b30 100644 --- a/pkg/controller/transfer/setup.go +++ b/pkg/controller/transfer/setup.go @@ -17,9 +17,8 @@ limitations under the License. package transfer import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/server" "github.com/crossplane-contrib/provider-aws/pkg/controller/transfer/user" diff --git a/pkg/controller/transfer/user/setup.go b/pkg/controller/transfer/user/setup.go index c57b0277c5..96ffcd3e26 100644 --- a/pkg/controller/transfer/user/setup.go +++ b/pkg/controller/transfer/user/setup.go @@ -16,16 +16,15 @@ package user import ( "context" - xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" - "github.com/crossplane/crossplane-runtime/pkg/controller" - ctrl "sigs.k8s.io/controller-runtime" - svcsdk "github.com/aws/aws-sdk-go/service/transfer" + xpv1 "github.com/crossplane/crossplane-runtime/apis/common/v1" "github.com/crossplane/crossplane-runtime/pkg/connection" + "github.com/crossplane/crossplane-runtime/pkg/controller" "github.com/crossplane/crossplane-runtime/pkg/event" "github.com/crossplane/crossplane-runtime/pkg/meta" "github.com/crossplane/crossplane-runtime/pkg/reconciler/managed" "github.com/crossplane/crossplane-runtime/pkg/resource" + ctrl "sigs.k8s.io/controller-runtime" svcapitypes "github.com/crossplane-contrib/provider-aws/apis/transfer/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" diff --git a/pkg/utils/metrics/setup.go b/pkg/utils/metrics/setup.go index 66ec5ba566..d3929dae9a 100644 --- a/pkg/utils/metrics/setup.go +++ b/pkg/utils/metrics/setup.go @@ -2,7 +2,6 @@ package metrics import ( "github.com/prometheus/client_golang/prometheus" - k8smetrics "sigs.k8s.io/controller-runtime/pkg/metrics" ) diff --git a/pkg/utils/setup/setup_controller.go b/pkg/utils/setup/setup_controller.go index 8644ccc209..fecc7ffedd 100644 --- a/pkg/utils/setup/setup_controller.go +++ b/pkg/utils/setup/setup_controller.go @@ -17,9 +17,8 @@ limitations under the License. package setup import ( - ctrl "sigs.k8s.io/controller-runtime" - "github.com/crossplane/crossplane-runtime/pkg/controller" + ctrl "sigs.k8s.io/controller-runtime" ) // SetupControllerFn is a delegate to initialize a controller.