Skip to content

Commit

Permalink
Merge pull request #855 from muvaf/fix-master
Browse files Browse the repository at this point in the history
Complete AWS SDK v2 Migration
  • Loading branch information
muvaf authored Oct 4, 2021
2 parents f282891 + 0fab933 commit 4745181
Show file tree
Hide file tree
Showing 244 changed files with 915 additions and 1,353 deletions.
6 changes: 3 additions & 3 deletions CODE_GENERATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ func SetupStage(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter, po
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(controller.Options{
RateLimiter: ratelimiter.NewDefaultManagedRateLimiter(rl),
RateLimiter: ratelimiter.NewController(rl),
}).
For(&svcapitypes.Stage{}).
Complete(managed.NewReconciler(mgr,
Expand Down Expand Up @@ -185,13 +185,13 @@ func SetupStage(mgr ctrl.Manager, l logging.Logger, rl workqueue.RateLimiter, po
return ctrl.NewControllerManagedBy(mgr).
Named(name).
WithOptions(controller.Options{
RateLimiter: ratelimiter.NewDefaultManagedRateLimiter(rl),
RateLimiter: ratelimiter.NewController(rl),
}).
For(&svcapitypes.Stage{}).
Complete(managed.NewReconciler(mgr,
resource.ManagedKind(svcapitypes.StageGroupVersionKind),
managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}),
managed.WithInitializers(managed.NewDefaultProviderConfig(mgr.GetClient())),
managed.WithInitializers(),
managed.WithPollInterval(poll),
managed.WithLogger(l.WithValues("controller", name)),
managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name)))))
Expand Down
2 changes: 1 addition & 1 deletion apis/ec2/v1beta1/routetable_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ func (a *Association) ClearRefSelectors() {
// AssociationState describes an association state in the route table.
type AssociationState struct {
// Indicates whether this is the main route table.
Main bool `json:"main"`
Main *bool `json:"main"`

// The ID of the association between a route table and a subnet.
AssociationID string `json:"associationId,omitempty"`
Expand Down
9 changes: 8 additions & 1 deletion apis/ec2/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion apis/s3/v1beta1/CORSConfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@ type CORSRule struct {
// The time in seconds that your browser is to cache the preflight response
// for the specified resource.
// +optional
MaxAgeSeconds *int32 `json:"maxAgeSeconds,omitempty"`
MaxAgeSeconds int32 `json:"maxAgeSeconds,omitempty"`
}
10 changes: 5 additions & 5 deletions apis/s3/v1beta1/lifecycleConfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,13 @@ type LifecycleExpiration struct {
// Indicates the lifetime, in days, of the objects that are subject to the rule.
// The value must be a non-zero positive integer.
// +kubebuilder:validation:Minimum=1
Days *int32 `json:"days,omitempty"`
Days int32 `json:"days,omitempty"`

// Indicates whether Amazon S3 will remove a delete marker with no noncurrent
// versions. If set to true, the delete marker will be expired; if set to false
// the policy takes no action. This cannot be specified with Days or Date in
// a Lifecycle Expiration Policy.
ExpiredObjectDeleteMarker *bool `json:"expiredObjectDeleteMarker,omitempty"`
ExpiredObjectDeleteMarker bool `json:"expiredObjectDeleteMarker,omitempty"`
}

// LifecycleRuleFilter is used to identify objects that a Lifecycle Rule applies to.
Expand Down Expand Up @@ -145,7 +145,7 @@ type NoncurrentVersionExpiration struct {
// calculations, see How Amazon S3 Calculates When an Object Became Noncurrent
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations)
// in the Amazon Simple Storage Service Developer Guide.
NoncurrentDays *int32 `json:"noncurrentDays,omitempty"`
NoncurrentDays int32 `json:"noncurrentDays,omitempty"`
}

// NoncurrentVersionTransition contains the transition rule that describes when noncurrent objects
Expand All @@ -161,7 +161,7 @@ type NoncurrentVersionTransition struct {
// calculations, see How Amazon S3 Calculates How Long an Object Has Been Noncurrent
// (https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations)
// in the Amazon Simple Storage Service Developer Guide.
NoncurrentDays *int32 `json:"noncurrentDays,omitempty"`
NoncurrentDays int32 `json:"noncurrentDays,omitempty"`

// The class of storage used to store the object.
// Valid values are: GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
Expand All @@ -181,7 +181,7 @@ type Transition struct {
// Indicates the number of days after creation when objects are transitioned
// to the specified storage class. The value must be a positive integer.
// +kubebuilder:validation:Minimum=1
Days *int32 `json:"days,omitempty"`
Days int32 `json:"days,omitempty"`

// The storage class to which you want the object to transition.
// Valid values are: GLACIER, STANDARD_IA, ONEZONE_IA, INTELLIGENT_TIERING, DEEP_ARCHIVE
Expand Down
4 changes: 2 additions & 2 deletions apis/s3/v1beta1/replicationConfiguration_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ type ReplicationRule struct {
//
// For more information, see Replication (https://docs.aws.amazon.com/AmazonS3/latest/dev/replication.html)
// in the Amazon Simple Storage Service Developer Guide.
Priority *int32 `json:"priority,omitempty"`
Priority int32 `json:"priority,omitempty"`

// A container that describes additional filters for identifying the source
// objects that you want to replicate. You can choose to enable or disable the
Expand Down Expand Up @@ -206,7 +206,7 @@ type EncryptionConfiguration struct {
// supports symmetric customer managed CMKs. For more information, see Using
// Symmetric and Asymmetric Keys (https://docs.aws.amazon.com/kms/latest/developerguide/symmetric-asymmetric.html)
// in the AWS Key Management Service Developer Guide.
ReplicaKmsKeyID string `json:"replicaKmsKeyId"`
ReplicaKmsKeyID *string `json:"replicaKmsKeyId"`
}

// Metrics specifies replication metrics-related settings enabling metrics
Expand Down
48 changes: 8 additions & 40 deletions apis/s3/v1beta1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion build
2 changes: 1 addition & 1 deletion cmd/provider/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ func main() {
kingpin.FatalIfError(err, "Cannot create controller manager")

kingpin.FatalIfError(apis.AddToScheme(mgr.GetScheme()), "Cannot add AWS APIs to scheme")
kingpin.FatalIfError(controller.Setup(mgr, log, ratelimiter.NewDefaultProviderRateLimiter(ratelimiter.DefaultProviderRPS), *pollInterval), "Cannot setup AWS controllers")
kingpin.FatalIfError(controller.Setup(mgr, log, ratelimiter.NewGlobal(ratelimiter.DefaultGlobalRPS), *pollInterval), "Cannot setup AWS controllers")
kingpin.FatalIfError(mgr.Start(ctrl.SetupSignalHandler()), "Cannot start controller manager")

}
56 changes: 28 additions & 28 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -4,39 +4,39 @@ go 1.16

require (
github.com/aws/aws-sdk-go v1.37.4
github.com/aws/aws-sdk-go-v2 v1.3.3
github.com/aws/aws-sdk-go-v2/config v1.1.6
github.com/aws/aws-sdk-go-v2/credentials v1.1.6
github.com/aws/aws-sdk-go-v2/service/acm v1.2.2
github.com/aws/aws-sdk-go-v2/service/acmpca v1.2.2
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.3.1
github.com/aws/aws-sdk-go-v2/service/ec2 v1.5.0
github.com/aws/aws-sdk-go-v2/service/ecr v1.2.2
github.com/aws/aws-sdk-go-v2/service/eks v1.2.2
github.com/aws/aws-sdk-go-v2/service/elasticache v1.3.0
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.2.2
github.com/aws/aws-sdk-go-v2/service/iam v1.3.1
github.com/aws/aws-sdk-go-v2/service/rds v1.3.0
github.com/aws/aws-sdk-go-v2/service/redshift v1.4.0
github.com/aws/aws-sdk-go-v2/service/route53 v1.4.0
github.com/aws/aws-sdk-go-v2/service/s3 v1.5.0
github.com/aws/aws-sdk-go-v2/service/sns v1.2.2
github.com/aws/aws-sdk-go-v2/service/sqs v1.3.1
github.com/aws/aws-sdk-go-v2/service/sts v1.3.0
github.com/aws/smithy-go v1.3.1
github.com/crossplane/crossplane-runtime v0.14.1-0.20210722005935-0b469fcc77cd
github.com/aws/aws-sdk-go-v2 v1.9.1
github.com/aws/aws-sdk-go-v2/config v1.8.2
github.com/aws/aws-sdk-go-v2/credentials v1.4.2
github.com/aws/aws-sdk-go-v2/service/acm v1.6.1
github.com/aws/aws-sdk-go-v2/service/acmpca v1.8.1
github.com/aws/aws-sdk-go-v2/service/cloudformation v1.10.1
github.com/aws/aws-sdk-go-v2/service/ec2 v1.18.0
github.com/aws/aws-sdk-go-v2/service/ecr v1.7.0
github.com/aws/aws-sdk-go-v2/service/eks v1.10.1
github.com/aws/aws-sdk-go-v2/service/elasticache v1.11.1
github.com/aws/aws-sdk-go-v2/service/elasticloadbalancing v1.6.1
github.com/aws/aws-sdk-go-v2/service/iam v1.10.0
github.com/aws/aws-sdk-go-v2/service/rds v1.9.0
github.com/aws/aws-sdk-go-v2/service/redshift v1.11.1
github.com/aws/aws-sdk-go-v2/service/route53 v1.11.1
github.com/aws/aws-sdk-go-v2/service/s3 v1.16.0
github.com/aws/aws-sdk-go-v2/service/sns v1.8.1
github.com/aws/aws-sdk-go-v2/service/sqs v1.9.1
github.com/aws/aws-sdk-go-v2/service/sts v1.7.1
github.com/aws/smithy-go v1.8.0
github.com/crossplane/crossplane-runtime v0.15.1-0.20210930095326-d5661210733b
github.com/crossplane/crossplane-tools v0.0.0-20210320162312-1baca298c527
github.com/evanphx/json-patch v4.11.0+incompatible
github.com/go-ini/ini v1.46.0
github.com/google/go-cmp v0.5.5
github.com/google/go-cmp v0.5.6
github.com/mitchellh/copystructure v1.0.0
github.com/onsi/gomega v1.13.0
github.com/onsi/gomega v1.14.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.7.0
gopkg.in/alecthomas/kingpin.v2 v2.2.6
k8s.io/api v0.21.2
k8s.io/apimachinery v0.21.2
k8s.io/client-go v0.21.2
sigs.k8s.io/controller-runtime v0.9.2
sigs.k8s.io/controller-tools v0.4.0
k8s.io/api v0.21.3
k8s.io/apimachinery v0.21.3
k8s.io/client-go v0.21.3
sigs.k8s.io/controller-runtime v0.9.6
sigs.k8s.io/controller-tools v0.6.2
)
Loading

0 comments on commit 4745181

Please sign in to comment.