diff --git a/pkg/controller/acm/controller.go b/pkg/controller/acm/controller.go index c34aa9e384..5a40d18bb5 100644 --- a/pkg/controller/acm/controller.go +++ b/pkg/controller/acm/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupCertificate(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{client: mgr.GetClient(), newClientFn: acm.NewClient}), managed.WithConnectionPublishers(), managed.WithInitializers(), diff --git a/pkg/controller/acmpca/certificateauthority/controller.go b/pkg/controller/acmpca/certificateauthority/controller.go index 659a06b79c..8ee95fa0e3 100644 --- a/pkg/controller/acmpca/certificateauthority/controller.go +++ b/pkg/controller/acmpca/certificateauthority/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -67,6 +68,7 @@ func SetupCertificateAuthority(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{client: mgr.GetClient(), newClientFn: acmpca.NewClient}), managed.WithConnectionPublishers(), managed.WithInitializers(), diff --git a/pkg/controller/acmpca/certificateauthoritypermission/controller.go b/pkg/controller/acmpca/certificateauthoritypermission/controller.go index a284bf1536..83c925e5d4 100644 --- a/pkg/controller/acmpca/certificateauthoritypermission/controller.go +++ b/pkg/controller/acmpca/certificateauthoritypermission/controller.go @@ -41,6 +41,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupCertificateAuthorityPermission(mgr ctrl.Manager, o controller.Options) } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{client: mgr.GetClient(), newClientFn: acmpca.NewCAPermissionClient}), managed.WithConnectionPublishers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigateway/method/setup.go b/pkg/controller/apigateway/method/setup.go index e1c8637c44..62242f7948 100644 --- a/pkg/controller/apigateway/method/setup.go +++ b/pkg/controller/apigateway/method/setup.go @@ -19,6 +19,7 @@ import ( apigwclient "github.com/crossplane-contrib/provider-aws/pkg/clients/apigateway" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupMethod adds a controller that reconciles Method. @@ -39,6 +40,7 @@ func SetupMethod(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigateway/resource/setup.go b/pkg/controller/apigateway/resource/setup.go index 3d0a60f063..91a5d519b0 100644 --- a/pkg/controller/apigateway/resource/setup.go +++ b/pkg/controller/apigateway/resource/setup.go @@ -37,6 +37,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResource adds a controller that reconciles Resource. @@ -59,6 +60,7 @@ func SetupResource(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigateway/restapi/setup.go b/pkg/controller/apigateway/restapi/setup.go index 636796c4e1..37ac5f42bd 100644 --- a/pkg/controller/apigateway/restapi/setup.go +++ b/pkg/controller/apigateway/restapi/setup.go @@ -37,6 +37,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupRestAPI adds a controller that reconciles RestAPI. @@ -58,6 +59,7 @@ func SetupRestAPI(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/api/setup.go b/pkg/controller/apigatewayv2/api/setup.go index 9b66c90b77..d8131b94e6 100644 --- a/pkg/controller/apigatewayv2/api/setup.go +++ b/pkg/controller/apigatewayv2/api/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAPI adds a controller that reconciles API. @@ -53,6 +54,7 @@ func SetupAPI(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/apimapping/setup.go b/pkg/controller/apigatewayv2/apimapping/setup.go index 8f268e4ff5..5b73f1b66f 100644 --- a/pkg/controller/apigatewayv2/apimapping/setup.go +++ b/pkg/controller/apigatewayv2/apimapping/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAPIMapping adds a controller that reconciles APIMapping. @@ -54,6 +55,7 @@ func SetupAPIMapping(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/authorizer/setup.go b/pkg/controller/apigatewayv2/authorizer/setup.go index b91dd7beda..271f9adfe1 100644 --- a/pkg/controller/apigatewayv2/authorizer/setup.go +++ b/pkg/controller/apigatewayv2/authorizer/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAuthorizer adds a controller that reconciles Authorizer. @@ -54,6 +55,7 @@ func SetupAuthorizer(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/deployment/setup.go b/pkg/controller/apigatewayv2/deployment/setup.go index c23f12ee9d..d8e78860cb 100644 --- a/pkg/controller/apigatewayv2/deployment/setup.go +++ b/pkg/controller/apigatewayv2/deployment/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDeployment adds a controller that reconciles Deployment. @@ -54,6 +55,7 @@ func SetupDeployment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/domainname/setup.go b/pkg/controller/apigatewayv2/domainname/setup.go index 40992a2b75..989863d5e5 100644 --- a/pkg/controller/apigatewayv2/domainname/setup.go +++ b/pkg/controller/apigatewayv2/domainname/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDomainName adds a controller that reconciles DomainName. @@ -53,6 +54,7 @@ func SetupDomainName(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/apigatewayv2/integration/setup.go b/pkg/controller/apigatewayv2/integration/setup.go index 3888f3b31c..4ae6256b76 100644 --- a/pkg/controller/apigatewayv2/integration/setup.go +++ b/pkg/controller/apigatewayv2/integration/setup.go @@ -34,6 +34,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupIntegration adds a controller that reconciles Integration. @@ -55,6 +56,7 @@ func SetupIntegration(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/integrationresponse/setup.go b/pkg/controller/apigatewayv2/integrationresponse/setup.go index 0f57ce6f11..1d5bf9d7c8 100644 --- a/pkg/controller/apigatewayv2/integrationresponse/setup.go +++ b/pkg/controller/apigatewayv2/integrationresponse/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupIntegrationResponse adds a controller that reconciles IntegrationResponse. @@ -54,6 +55,7 @@ func SetupIntegrationResponse(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/model/setup.go b/pkg/controller/apigatewayv2/model/setup.go index 9e2fc5aca2..553489c455 100644 --- a/pkg/controller/apigatewayv2/model/setup.go +++ b/pkg/controller/apigatewayv2/model/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupModel adds a controller that reconciles Model. @@ -54,6 +55,7 @@ func SetupModel(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/route/setup.go b/pkg/controller/apigatewayv2/route/setup.go index 7298ee0581..631b176b93 100644 --- a/pkg/controller/apigatewayv2/route/setup.go +++ b/pkg/controller/apigatewayv2/route/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupRoute adds a controller that reconciles Route. @@ -54,6 +55,7 @@ func SetupRoute(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/routeresponse/setup.go b/pkg/controller/apigatewayv2/routeresponse/setup.go index 2c485910dd..0bd678be21 100644 --- a/pkg/controller/apigatewayv2/routeresponse/setup.go +++ b/pkg/controller/apigatewayv2/routeresponse/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupRouteResponse adds a controller that reconciles RouteResponse. @@ -54,6 +55,7 @@ func SetupRouteResponse(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/apigatewayv2/stage/setup.go b/pkg/controller/apigatewayv2/stage/setup.go index 5fbfbd5176..50ff3c8db8 100644 --- a/pkg/controller/apigatewayv2/stage/setup.go +++ b/pkg/controller/apigatewayv2/stage/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupStage adds a controller that reconciles Stage. @@ -53,6 +54,7 @@ func SetupStage(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/apigatewayv2/vpclink/setup.go b/pkg/controller/apigatewayv2/vpclink/setup.go index 41fd347cb9..315a4c92a4 100644 --- a/pkg/controller/apigatewayv2/vpclink/setup.go +++ b/pkg/controller/apigatewayv2/vpclink/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/apigatewayv2/v1beta1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupVPCLink adds a controller that reconciles VPCLink. @@ -54,6 +55,7 @@ func SetupVPCLink(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/athena/workgroup/setup.go b/pkg/controller/athena/workgroup/setup.go index a60c584441..776fec4f7d 100644 --- a/pkg/controller/athena/workgroup/setup.go +++ b/pkg/controller/athena/workgroup/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupWorkGroup adds a controller that reconciles WorkGroup. @@ -51,6 +52,7 @@ func SetupWorkGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), diff --git a/pkg/controller/autoscaling/autoscalinggroup/setup.go b/pkg/controller/autoscaling/autoscalinggroup/setup.go index f846a2f764..c6f8385fa7 100644 --- a/pkg/controller/autoscaling/autoscalinggroup/setup.go +++ b/pkg/controller/autoscaling/autoscalinggroup/setup.go @@ -22,6 +22,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAutoScalingGroup adds a controller that reconciles AutoScalingGroup. @@ -44,6 +45,7 @@ func SetupAutoScalingGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/batch/computeenvironment/setup.go b/pkg/controller/batch/computeenvironment/setup.go index 9f99e1eca2..f7bc6b110d 100644 --- a/pkg/controller/batch/computeenvironment/setup.go +++ b/pkg/controller/batch/computeenvironment/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupComputeEnvironment adds a controller that reconciles a ComputeEnvironment. @@ -54,6 +55,7 @@ func SetupComputeEnvironment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/batch/job/controller.go b/pkg/controller/batch/job/controller.go index d95336db1b..7d325f5349 100644 --- a/pkg/controller/batch/job/controller.go +++ b/pkg/controller/batch/job/controller.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -62,6 +63,7 @@ func SetupJob(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/batch/jobdefinition/controller.go b/pkg/controller/batch/jobdefinition/controller.go index 11762875ce..cadd69f88a 100644 --- a/pkg/controller/batch/jobdefinition/controller.go +++ b/pkg/controller/batch/jobdefinition/controller.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -63,6 +64,7 @@ func SetupJobDefinition(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), managed.WithInitializers(&externalNameGenerator{kube: mgr.GetClient()}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/batch/jobqueue/setup.go b/pkg/controller/batch/jobqueue/setup.go index 33645ee44c..bafdf74b57 100644 --- a/pkg/controller/batch/jobqueue/setup.go +++ b/pkg/controller/batch/jobqueue/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -59,6 +60,7 @@ func SetupJobQueue(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/cache/cachesubnetgroup/controller.go b/pkg/controller/cache/cachesubnetgroup/controller.go index 2531c5d156..1197fbb39c 100644 --- a/pkg/controller/cache/cachesubnetgroup/controller.go +++ b/pkg/controller/cache/cachesubnetgroup/controller.go @@ -39,6 +39,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // Error strings. @@ -60,6 +61,7 @@ func SetupCacheSubnetGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: elasticache.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/cache/cluster/controller.go b/pkg/controller/cache/cluster/controller.go index 6e5743f439..5e65a77b4d 100644 --- a/pkg/controller/cache/cluster/controller.go +++ b/pkg/controller/cache/cluster/controller.go @@ -39,6 +39,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // Error strings. @@ -62,6 +63,7 @@ func SetupCacheCluster(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: elasticache.NewClient}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cache/replicationgroup/managed.go b/pkg/controller/cache/replicationgroup/managed.go index 4609b3f5c2..5e92ab59ef 100644 --- a/pkg/controller/cache/replicationgroup/managed.go +++ b/pkg/controller/cache/replicationgroup/managed.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // Error strings. @@ -72,6 +73,7 @@ func SetupReplicationGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: elasticache.NewClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/cloudfront/cachepolicy/setup.go b/pkg/controller/cloudfront/cachepolicy/setup.go index 69bf428a9e..2cae4543cc 100644 --- a/pkg/controller/cloudfront/cachepolicy/setup.go +++ b/pkg/controller/cloudfront/cachepolicy/setup.go @@ -34,6 +34,7 @@ import ( cloudfront "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupCachePolicy adds a controller that reconciles CachePolicy. @@ -46,6 +47,7 @@ func SetupCachePolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{ kube: mgr.GetClient(), opts: []option{ diff --git a/pkg/controller/cloudfront/cloudfrontoriginaccessidentity/setup.go b/pkg/controller/cloudfront/cloudfrontoriginaccessidentity/setup.go index c81f73f6d0..a6bb0d8ee3 100644 --- a/pkg/controller/cloudfront/cloudfrontoriginaccessidentity/setup.go +++ b/pkg/controller/cloudfront/cloudfrontoriginaccessidentity/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupCloudFrontOriginAccessIdentity adds a controller that reconciles CloudFrontOriginAccessIdentity . @@ -46,6 +47,7 @@ func SetupCloudFrontOriginAccessIdentity(mgr ctrl.Manager, o controller.Options) } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{ kube: mgr.GetClient(), opts: []option{ diff --git a/pkg/controller/cloudfront/distribution/setup.go b/pkg/controller/cloudfront/distribution/setup.go index b68ee43783..7cdd135193 100644 --- a/pkg/controller/cloudfront/distribution/setup.go +++ b/pkg/controller/cloudfront/distribution/setup.go @@ -38,6 +38,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // TODO: Aren't these defined as an API constant somewhere in aws-sdk-go? @@ -56,6 +57,7 @@ func SetupDistribution(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{ kube: mgr.GetClient(), opts: []option{ diff --git a/pkg/controller/cloudfront/responseheaderspolicy/setup.go b/pkg/controller/cloudfront/responseheaderspolicy/setup.go index dc6144fa6e..aaf49a0e7e 100644 --- a/pkg/controller/cloudfront/responseheaderspolicy/setup.go +++ b/pkg/controller/cloudfront/responseheaderspolicy/setup.go @@ -34,6 +34,7 @@ import ( cloudfront "github.com/crossplane-contrib/provider-aws/pkg/controller/cloudfront/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResponseHeadersPolicy adds a controller that reconciles ResponseHeadersPolicy. @@ -46,6 +47,7 @@ func SetupResponseHeadersPolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{ kube: mgr.GetClient(), opts: []option{ diff --git a/pkg/controller/cloudsearch/domain/setup.go b/pkg/controller/cloudsearch/domain/setup.go index ac8b12760e..cbc97fcd20 100644 --- a/pkg/controller/cloudsearch/domain/setup.go +++ b/pkg/controller/cloudsearch/domain/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" legacypolicy "github.com/crossplane-contrib/provider-aws/pkg/utils/policy/old" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -58,6 +59,7 @@ func SetupDomain(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cloudwatchlogs/loggroup/setup.go b/pkg/controller/cloudwatchlogs/loggroup/setup.go index 669ba76fbd..74d4bcea54 100644 --- a/pkg/controller/cloudwatchlogs/loggroup/setup.go +++ b/pkg/controller/cloudwatchlogs/loggroup/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" tagutils "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -66,6 +67,7 @@ func SetupLogGroup(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentity/identitypool/setup.go b/pkg/controller/cognitoidentity/identitypool/setup.go index 93393ac2d9..8aaa6b200e 100644 --- a/pkg/controller/cognitoidentity/identitypool/setup.go +++ b/pkg/controller/cognitoidentity/identitypool/setup.go @@ -31,6 +31,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupIdentityPool adds a controller that reconciles IdentityPool. @@ -56,6 +57,7 @@ func SetupIdentityPool(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/group/setup.go b/pkg/controller/cognitoidentityprovider/group/setup.go index 047b5c4163..50ed8697eb 100644 --- a/pkg/controller/cognitoidentityprovider/group/setup.go +++ b/pkg/controller/cognitoidentityprovider/group/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupGroup adds a controller that reconciles Group. @@ -54,6 +55,7 @@ func SetupGroup(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go b/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go index 4bb9167756..2502965284 100644 --- a/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go +++ b/pkg/controller/cognitoidentityprovider/groupusermembership/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -63,6 +64,7 @@ func SetupGroupUserMembership(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: awscognitoidpclient.NewGroupUserMembershipClient}), managed.WithConnectionPublishers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/cognitoidentityprovider/identityprovider/setup.go b/pkg/controller/cognitoidentityprovider/identityprovider/setup.go index 79fa742844..8f5ffeeb4a 100644 --- a/pkg/controller/cognitoidentityprovider/identityprovider/setup.go +++ b/pkg/controller/cognitoidentityprovider/identityprovider/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/clients/cognitoidentityprovider" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupIdentityProvider adds a controller that reconciles IdentityProvider. @@ -60,6 +61,7 @@ func SetupIdentityProvider(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/resourceserver/setup.go b/pkg/controller/cognitoidentityprovider/resourceserver/setup.go index ddb1d246a5..3f37ad8ffd 100644 --- a/pkg/controller/cognitoidentityprovider/resourceserver/setup.go +++ b/pkg/controller/cognitoidentityprovider/resourceserver/setup.go @@ -17,6 +17,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResourceServer adds a controller that reconciles Stage. @@ -38,6 +39,7 @@ func SetupResourceServer(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/userpool/setup.go b/pkg/controller/cognitoidentityprovider/userpool/setup.go index b73219564a..3a2a16e5dc 100644 --- a/pkg/controller/cognitoidentityprovider/userpool/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpool/setup.go @@ -33,6 +33,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -67,6 +68,7 @@ func SetupUserPool(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go b/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go index 07e19ca34d..1f314659c4 100644 --- a/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpoolclient/setup.go @@ -31,6 +31,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupUserPoolClient adds a controller that reconciles UserPoolClient. @@ -57,6 +58,7 @@ func SetupUserPoolClient(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go b/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go index 2fe56b9414..e9071afba3 100644 --- a/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go +++ b/pkg/controller/cognitoidentityprovider/userpooldomain/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupUserPoolDomain adds a controller that reconciles User. @@ -52,6 +53,7 @@ func SetupUserPoolDomain(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), managed.WithConnectionPublishers(cps...), diff --git a/pkg/controller/database/dbsubnetgroup/controller.go b/pkg/controller/database/dbsubnetgroup/controller.go index 2b1d1555d0..52fc1af7c6 100644 --- a/pkg/controller/database/dbsubnetgroup/controller.go +++ b/pkg/controller/database/dbsubnetgroup/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupDBSubnetGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: dbsg.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/database/rdsinstance/rdsinstance.go b/pkg/controller/database/rdsinstance/rdsinstance.go index 5cd8b342f4..9b7dfc9ed2 100644 --- a/pkg/controller/database/rdsinstance/rdsinstance.go +++ b/pkg/controller/database/rdsinstance/rdsinstance.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -71,6 +72,7 @@ func SetupRDSInstance(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: rds.NewClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/dax/cluster/setup.go b/pkg/controller/dax/cluster/setup.go index 392288111a..3dcb8faf73 100644 --- a/pkg/controller/dax/cluster/setup.go +++ b/pkg/controller/dax/cluster/setup.go @@ -16,6 +16,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupCluster adds a controller that reconciles Cluster. @@ -34,6 +35,7 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/dax/parametergroup/setup.go b/pkg/controller/dax/parametergroup/setup.go index 7b41e4eb05..13158b76a7 100644 --- a/pkg/controller/dax/parametergroup/setup.go +++ b/pkg/controller/dax/parametergroup/setup.go @@ -18,6 +18,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupParameterGroup adds a controller that reconciles ParameterGroup. @@ -37,6 +38,7 @@ func SetupParameterGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/dax/subnetgroup/setup.go b/pkg/controller/dax/subnetgroup/setup.go index 0b8123074d..aee98c4599 100644 --- a/pkg/controller/dax/subnetgroup/setup.go +++ b/pkg/controller/dax/subnetgroup/setup.go @@ -16,6 +16,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dax/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupSubnetGroup adds a controller that reconciles SubnetGroup. @@ -33,6 +34,7 @@ func SetupSubnetGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/docdb/dbcluster/setup.go b/pkg/controller/docdb/dbcluster/setup.go index c0d1fbf58b..62df43808e 100644 --- a/pkg/controller/docdb/dbcluster/setup.go +++ b/pkg/controller/docdb/dbcluster/setup.go @@ -43,6 +43,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupDBCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/docdb/dbclusterparametergroup/setup.go b/pkg/controller/docdb/dbclusterparametergroup/setup.go index 8ccccf5fbc..902127a31c 100644 --- a/pkg/controller/docdb/dbclusterparametergroup/setup.go +++ b/pkg/controller/docdb/dbclusterparametergroup/setup.go @@ -38,6 +38,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -59,6 +60,7 @@ func SetupDBClusterParameterGroup(mgr ctrl.Manager, o controller.Options) error } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/docdb/dbinstance/setup.go b/pkg/controller/docdb/dbinstance/setup.go index ddeb9207f3..ad948f918e 100644 --- a/pkg/controller/docdb/dbinstance/setup.go +++ b/pkg/controller/docdb/dbinstance/setup.go @@ -37,6 +37,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDBInstance adds a controller that reconciles a DBInstance. @@ -50,6 +51,7 @@ func SetupDBInstance(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/docdb/dbsubnetgroup/setup.go b/pkg/controller/docdb/dbsubnetgroup/setup.go index c3f9a2b79b..d40779121c 100644 --- a/pkg/controller/docdb/dbsubnetgroup/setup.go +++ b/pkg/controller/docdb/dbsubnetgroup/setup.go @@ -36,6 +36,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/docdb/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDBSubnetGroup adds a controller that reconciles a DBSubnetGroup. @@ -49,6 +50,7 @@ func SetupDBSubnetGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/dynamodb/backup/hooks.go b/pkg/controller/dynamodb/backup/hooks.go index 9bde377116..0e260e704f 100644 --- a/pkg/controller/dynamodb/backup/hooks.go +++ b/pkg/controller/dynamodb/backup/hooks.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/dynamodb/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupBackup adds a controller that reconciles Backup. @@ -54,6 +55,7 @@ func SetupBackup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/dynamodb/globaltable/hooks.go b/pkg/controller/dynamodb/globaltable/hooks.go index 4b838d9bb3..25765b8c92 100644 --- a/pkg/controller/dynamodb/globaltable/hooks.go +++ b/pkg/controller/dynamodb/globaltable/hooks.go @@ -38,6 +38,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupGlobalTable adds a controller that reconciles GlobalTable. @@ -62,6 +63,7 @@ func SetupGlobalTable(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/dynamodb/table/hooks.go b/pkg/controller/dynamodb/table/hooks.go index 2a6bb9fa47..b53332f0de 100644 --- a/pkg/controller/dynamodb/table/hooks.go +++ b/pkg/controller/dynamodb/table/hooks.go @@ -46,6 +46,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -62,6 +63,7 @@ func SetupTable(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&customConnector{kube: mgr.GetClient()}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ec2/address/controller.go b/pkg/controller/ec2/address/controller.go index 952f365651..5ecd659d78 100644 --- a/pkg/controller/ec2/address/controller.go +++ b/pkg/controller/ec2/address/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupAddress(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/flowlog/setup.go b/pkg/controller/ec2/flowlog/setup.go index e4a776fc67..1fd2b87ce7 100644 --- a/pkg/controller/ec2/flowlog/setup.go +++ b/pkg/controller/ec2/flowlog/setup.go @@ -22,6 +22,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) var ( @@ -64,6 +65,7 @@ func SetupFlowLog(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ec2/instance/controller.go b/pkg/controller/ec2/instance/controller.go index edf21b412f..45ceeaf9f9 100644 --- a/pkg/controller/ec2/instance/controller.go +++ b/pkg/controller/ec2/instance/controller.go @@ -41,6 +41,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -66,6 +67,7 @@ func SetupInstance(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewInstanceClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/internetgateway/controller.go b/pkg/controller/ec2/internetgateway/controller.go index 62294b58c8..b7452893c2 100644 --- a/pkg/controller/ec2/internetgateway/controller.go +++ b/pkg/controller/ec2/internetgateway/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupInternetGateway(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewInternetGatewayClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/launchtemplate/setup.go b/pkg/controller/ec2/launchtemplate/setup.go index ac4e8c4f86..f376890cd7 100644 --- a/pkg/controller/ec2/launchtemplate/setup.go +++ b/pkg/controller/ec2/launchtemplate/setup.go @@ -18,6 +18,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupLaunchTemplate adds a controller that reconciles LaunchTemplate. @@ -31,6 +32,7 @@ func SetupLaunchTemplate(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/ec2/launchtemplateversion/setup.go b/pkg/controller/ec2/launchtemplateversion/setup.go index ffb11a6a27..43c199a2ec 100644 --- a/pkg/controller/ec2/launchtemplateversion/setup.go +++ b/pkg/controller/ec2/launchtemplateversion/setup.go @@ -19,6 +19,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupLaunchTemplateVersion adds a controller that reconciles LaunchTemplateVersion. @@ -40,6 +41,7 @@ func SetupLaunchTemplateVersion(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ec2/natgateway/controller.go b/pkg/controller/ec2/natgateway/controller.go index f7d76753f4..4a189d828f 100644 --- a/pkg/controller/ec2/natgateway/controller.go +++ b/pkg/controller/ec2/natgateway/controller.go @@ -24,6 +24,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -46,6 +47,7 @@ func SetupNatGateway(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewNatGatewayClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/route/setup.go b/pkg/controller/ec2/route/setup.go index 5dadd896fb..4f99f18a14 100644 --- a/pkg/controller/ec2/route/setup.go +++ b/pkg/controller/ec2/route/setup.go @@ -20,6 +20,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -43,6 +44,7 @@ func SetupRoute(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ec2/routetable/controller.go b/pkg/controller/ec2/routetable/controller.go index 2290b8b5f8..47584c6818 100644 --- a/pkg/controller/ec2/routetable/controller.go +++ b/pkg/controller/ec2/routetable/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -71,6 +72,7 @@ func SetupRouteTable(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewRouteTableClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/securitygroup/controller.go b/pkg/controller/ec2/securitygroup/controller.go index 6bcb715200..647ebf237d 100644 --- a/pkg/controller/ec2/securitygroup/controller.go +++ b/pkg/controller/ec2/securitygroup/controller.go @@ -44,6 +44,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -74,6 +75,7 @@ func SetupSecurityGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewSecurityGroupClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/securitygrouprule/controller.go b/pkg/controller/ec2/securitygrouprule/controller.go index 5641180f7d..074d87fb63 100644 --- a/pkg/controller/ec2/securitygrouprule/controller.go +++ b/pkg/controller/ec2/securitygrouprule/controller.go @@ -24,6 +24,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -43,6 +44,7 @@ func SetupSecurityGroupRule(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewSecurityGroupRuleClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ec2/subnet/controller.go b/pkg/controller/ec2/subnet/controller.go index e699745e34..db1d46c7f5 100644 --- a/pkg/controller/ec2/subnet/controller.go +++ b/pkg/controller/ec2/subnet/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -66,6 +67,7 @@ func SetupSubnet(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewSubnetClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/transitgateway/setup.go b/pkg/controller/ec2/transitgateway/setup.go index 82a931d3fd..1e7a3f7acf 100644 --- a/pkg/controller/ec2/transitgateway/setup.go +++ b/pkg/controller/ec2/transitgateway/setup.go @@ -18,6 +18,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTransitGateway adds a controller that reconciles TransitGateway. @@ -39,6 +40,7 @@ func SetupTransitGateway(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithInitializers(), diff --git a/pkg/controller/ec2/transitgatewayroute/setup.go b/pkg/controller/ec2/transitgatewayroute/setup.go index f68da6b7a6..ff8b5d9208 100644 --- a/pkg/controller/ec2/transitgatewayroute/setup.go +++ b/pkg/controller/ec2/transitgatewayroute/setup.go @@ -23,6 +23,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTransitGatewayRoute adds a controller that reconciles TransitGatewayRoutes. @@ -43,6 +44,7 @@ func SetupTransitGatewayRoute(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ec2/transitgatewayroutetable/setup.go b/pkg/controller/ec2/transitgatewayroutetable/setup.go index cc756bede9..cf20abb1e9 100644 --- a/pkg/controller/ec2/transitgatewayroutetable/setup.go +++ b/pkg/controller/ec2/transitgatewayroutetable/setup.go @@ -21,6 +21,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTransitGatewayRouteTable adds a controller that reconciles TransitGatewayRouteTable. @@ -43,6 +44,7 @@ func SetupTransitGatewayRouteTable(mgr ctrl.Manager, o controller.Options) error } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ec2/transitgatewayvpcattachment/setup.go b/pkg/controller/ec2/transitgatewayvpcattachment/setup.go index 77e30939c6..a2608b2377 100644 --- a/pkg/controller/ec2/transitgatewayvpcattachment/setup.go +++ b/pkg/controller/ec2/transitgatewayvpcattachment/setup.go @@ -21,6 +21,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTransitGatewayVPCAttachment adds a controller that reconciles TransitGatewayVPCAttachment. @@ -42,6 +43,7 @@ func SetupTransitGatewayVPCAttachment(mgr ctrl.Manager, o controller.Options) er } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithInitializers(), diff --git a/pkg/controller/ec2/volume/setup.go b/pkg/controller/ec2/volume/setup.go index 6be4bee67a..8c7dd9837f 100644 --- a/pkg/controller/ec2/volume/setup.go +++ b/pkg/controller/ec2/volume/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupVolume adds a controller that reconciles Volume. @@ -51,6 +52,7 @@ func SetupVolume(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ec2/vpc/controller.go b/pkg/controller/ec2/vpc/controller.go index d46c76d3f3..7824ce50d8 100644 --- a/pkg/controller/ec2/vpc/controller.go +++ b/pkg/controller/ec2/vpc/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -67,6 +68,7 @@ func SetupVPC(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewVPCClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/vpccidrblock/controller.go b/pkg/controller/ec2/vpccidrblock/controller.go index 364be4d239..c50f0c4d51 100644 --- a/pkg/controller/ec2/vpccidrblock/controller.go +++ b/pkg/controller/ec2/vpccidrblock/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupVPCCIDRBlock(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: ec2.NewVPCCIDRBlockClient}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/ec2/vpcendpoint/setup.go b/pkg/controller/ec2/vpcendpoint/setup.go index 943b5a9c49..107576bc0f 100644 --- a/pkg/controller/ec2/vpcendpoint/setup.go +++ b/pkg/controller/ec2/vpcendpoint/setup.go @@ -24,6 +24,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" legacypolicy "github.com/crossplane-contrib/provider-aws/pkg/utils/policy/old" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupVPCEndpoint adds a controller that reconciles VPCEndpoint. @@ -37,6 +38,7 @@ func SetupVPCEndpoint(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go index f206431b34..7957038d64 100644 --- a/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go +++ b/pkg/controller/ec2/vpcendpointserviceconfiguration/setup.go @@ -22,6 +22,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupVPCEndpointServiceConfiguration adds a controller that reconciles VPCEndpointServiceConfiguration. @@ -47,6 +48,7 @@ func SetupVPCEndpointServiceConfiguration(mgr ctrl.Manager, o controller.Options } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/ec2/vpcpeeringconnection/setup.go b/pkg/controller/ec2/vpcpeeringconnection/setup.go index ebdcaf6a0d..72593c76e0 100644 --- a/pkg/controller/ec2/vpcpeeringconnection/setup.go +++ b/pkg/controller/ec2/vpcpeeringconnection/setup.go @@ -24,6 +24,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupVPCPeeringConnection adds a controller that reconciles VPCPeeringConnection. @@ -46,6 +47,7 @@ func SetupVPCPeeringConnection(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithCreationGracePeriod(3 * time.Minute), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ecr/lifecyclepolicy/setup.go b/pkg/controller/ecr/lifecyclepolicy/setup.go index 0b1740f145..9b4d6d7445 100644 --- a/pkg/controller/ecr/lifecyclepolicy/setup.go +++ b/pkg/controller/ecr/lifecyclepolicy/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecr/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupLifecyclePolicy adds a controller that reconciles LifecyclePolicy. @@ -35,6 +36,7 @@ func SetupLifecyclePolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ecr/repository/controller.go b/pkg/controller/ecr/repository/controller.go index d09a73e5a5..890188eb80 100644 --- a/pkg/controller/ecr/repository/controller.go +++ b/pkg/controller/ecr/repository/controller.go @@ -41,6 +41,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -71,6 +72,7 @@ func SetupRepository(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/ecr/repositorypolicy/controller.go b/pkg/controller/ecr/repositorypolicy/controller.go index 523c2fe7da..e87e933b3a 100644 --- a/pkg/controller/ecr/repositorypolicy/controller.go +++ b/pkg/controller/ecr/repositorypolicy/controller.go @@ -38,6 +38,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" legacypolicy "github.com/crossplane-contrib/provider-aws/pkg/utils/policy/old" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -59,6 +60,7 @@ func SetupRepositoryPolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient()}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ecs/cluster/setup.go b/pkg/controller/ecs/cluster/setup.go index 26e0af0826..f0fe01aab5 100644 --- a/pkg/controller/ecs/cluster/setup.go +++ b/pkg/controller/ecs/cluster/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupCluster adds a controller that reconciles Cluster. @@ -38,6 +39,7 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ecs/service/setup.go b/pkg/controller/ecs/service/setup.go index 0bba5fe9c0..35371d37d9 100644 --- a/pkg/controller/ecs/service/setup.go +++ b/pkg/controller/ecs/service/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupService adds a controller that reconciles Service. @@ -36,6 +37,7 @@ func SetupService(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/ecs/taskdefinition/setup.go b/pkg/controller/ecs/taskdefinition/setup.go index 354cad1982..53ce2a4b2c 100644 --- a/pkg/controller/ecs/taskdefinition/setup.go +++ b/pkg/controller/ecs/taskdefinition/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/ecs/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTaskDefinition adds a controller that reconciles TaskDefinition. @@ -39,6 +40,7 @@ func SetupTaskDefinition(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/efs/accesspoint/setup.go b/pkg/controller/efs/accesspoint/setup.go index 2a5f8313ba..f034a9796e 100644 --- a/pkg/controller/efs/accesspoint/setup.go +++ b/pkg/controller/efs/accesspoint/setup.go @@ -15,6 +15,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/efs/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAccessPoint adds a controller that reconciles AccessPoint. @@ -31,6 +32,7 @@ func SetupAccessPoint(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/efs/filesystem/setup.go b/pkg/controller/efs/filesystem/setup.go index 7369c618eb..6e9e7cfd14 100644 --- a/pkg/controller/efs/filesystem/setup.go +++ b/pkg/controller/efs/filesystem/setup.go @@ -18,6 +18,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupFileSystem adds a controller that reconciles FileSystem. @@ -42,6 +43,7 @@ func SetupFileSystem(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/efs/mounttarget/setup.go b/pkg/controller/efs/mounttarget/setup.go index 94e7be8f02..ca80489823 100644 --- a/pkg/controller/efs/mounttarget/setup.go +++ b/pkg/controller/efs/mounttarget/setup.go @@ -17,6 +17,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupMountTarget adds a controller that reconciles MountTarget. @@ -38,6 +39,7 @@ func SetupMountTarget(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithLogger(o.Logger.WithValues("controller", name)), managed.WithRecorder(event.NewAPIRecorder(mgr.GetEventRecorderFor(name))), diff --git a/pkg/controller/eks/addon/setup.go b/pkg/controller/eks/addon/setup.go index 63634d4990..4b969f6bf8 100644 --- a/pkg/controller/eks/addon/setup.go +++ b/pkg/controller/eks/addon/setup.go @@ -39,6 +39,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -62,6 +63,7 @@ func SetupAddon(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/eks/cluster/cluster.go b/pkg/controller/eks/cluster/cluster.go index 50dbfeb78b..d17f5a9629 100644 --- a/pkg/controller/eks/cluster/cluster.go +++ b/pkg/controller/eks/cluster/cluster.go @@ -40,6 +40,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -67,6 +68,7 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: eks.NewEKSClient, newSTSClientFn: eks.NewSTSClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/eks/fargateprofile/controller.go b/pkg/controller/eks/fargateprofile/controller.go index a451e06e50..2c25b49f1f 100644 --- a/pkg/controller/eks/fargateprofile/controller.go +++ b/pkg/controller/eks/fargateprofile/controller.go @@ -40,6 +40,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -62,6 +63,7 @@ func SetupFargateProfile(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newEKSClientFn: eks.NewEKSClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/eks/identityproviderconfig/controller.go b/pkg/controller/eks/identityproviderconfig/controller.go index 540f2c3718..ea6bcc3102 100644 --- a/pkg/controller/eks/identityproviderconfig/controller.go +++ b/pkg/controller/eks/identityproviderconfig/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" tagutils "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -63,6 +64,7 @@ func SetupIdentityProviderConfig(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newEKSClientFn: eks.NewEKSClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/eks/nodegroup/controller.go b/pkg/controller/eks/nodegroup/controller.go index c658efef87..3897596ef1 100644 --- a/pkg/controller/eks/nodegroup/controller.go +++ b/pkg/controller/eks/nodegroup/controller.go @@ -40,6 +40,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" tagutils "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -65,6 +66,7 @@ func SetupNodeGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newEKSClientFn: eks.NewEKSClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/elasticache/cacheparametergroup/setup.go b/pkg/controller/elasticache/cacheparametergroup/setup.go index 30961752cd..ebafabc02a 100644 --- a/pkg/controller/elasticache/cacheparametergroup/setup.go +++ b/pkg/controller/elasticache/cacheparametergroup/setup.go @@ -37,6 +37,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupCacheParameterGroup adds a controller that reconciles a CacheParameterGroup. @@ -50,6 +51,7 @@ func SetupCacheParameterGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/elasticloadbalancing/elb/controller.go b/pkg/controller/elasticloadbalancing/elb/controller.go index ee37539360..f99194173e 100644 --- a/pkg/controller/elasticloadbalancing/elb/controller.go +++ b/pkg/controller/elasticloadbalancing/elb/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupELB(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: elb.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/elasticloadbalancing/elbattachment/controller.go b/pkg/controller/elasticloadbalancing/elbattachment/controller.go index 91c5340ea6..db687cc46c 100644 --- a/pkg/controller/elasticloadbalancing/elbattachment/controller.go +++ b/pkg/controller/elasticloadbalancing/elbattachment/controller.go @@ -39,6 +39,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupELBAttachment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: elb.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/elbv2/listener/setup.go b/pkg/controller/elbv2/listener/setup.go index c9472d8460..097459a8a7 100644 --- a/pkg/controller/elbv2/listener/setup.go +++ b/pkg/controller/elbv2/listener/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupListener adds a controller that reconciles Listener. @@ -38,6 +39,7 @@ func SetupListener(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/elbv2/loadbalancer/setup.go b/pkg/controller/elbv2/loadbalancer/setup.go index 63cd9afacb..7b3c78350b 100644 --- a/pkg/controller/elbv2/loadbalancer/setup.go +++ b/pkg/controller/elbv2/loadbalancer/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/elbv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupLoadBalancer adds a controller that reconciles LoadBalancer. @@ -37,6 +38,7 @@ func SetupLoadBalancer(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/elbv2/target/controller.go b/pkg/controller/elbv2/target/controller.go index 2f7d5a5f66..92dfabb9eb 100644 --- a/pkg/controller/elbv2/target/controller.go +++ b/pkg/controller/elbv2/target/controller.go @@ -39,6 +39,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -58,6 +59,7 @@ func SetupTarget(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: awselasticloadbalancingv2.NewFromConfig}), managed.WithInitializers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/elbv2/targetgroup/setup.go b/pkg/controller/elbv2/targetgroup/setup.go index 27ca462c32..c7e391fa91 100644 --- a/pkg/controller/elbv2/targetgroup/setup.go +++ b/pkg/controller/elbv2/targetgroup/setup.go @@ -18,6 +18,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupTargetGroup adds a controller that reconciles TargetGroup. @@ -37,6 +38,7 @@ func SetupTargetGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/emrcontainers/jobrun/setup.go b/pkg/controller/emrcontainers/jobrun/setup.go index 0634839471..c3ad77722a 100644 --- a/pkg/controller/emrcontainers/jobrun/setup.go +++ b/pkg/controller/emrcontainers/jobrun/setup.go @@ -19,6 +19,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/emrcontainers/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -45,6 +46,7 @@ func SetupJobRun(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/emrcontainers/virtualcluster/setup.go b/pkg/controller/emrcontainers/virtualcluster/setup.go index c437aa3f89..41626d4023 100644 --- a/pkg/controller/emrcontainers/virtualcluster/setup.go +++ b/pkg/controller/emrcontainers/virtualcluster/setup.go @@ -20,6 +20,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/emrcontainers/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -52,6 +53,7 @@ func SetupVirtualCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/firehose/deliverystream/setup.go b/pkg/controller/firehose/deliverystream/setup.go index 60b01bf42c..a1b77060d8 100644 --- a/pkg/controller/firehose/deliverystream/setup.go +++ b/pkg/controller/firehose/deliverystream/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDeliveryStream adds a controller that reconciles DeliveryStream. @@ -57,6 +58,7 @@ func SetupDeliveryStream(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/globalaccelerator/accelerator/setup.go b/pkg/controller/globalaccelerator/accelerator/setup.go index 5d285a510c..e9d85cc465 100644 --- a/pkg/controller/globalaccelerator/accelerator/setup.go +++ b/pkg/controller/globalaccelerator/accelerator/setup.go @@ -20,6 +20,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAccelerator adds a controller that reconciles an Accelerator. @@ -49,6 +50,7 @@ func SetupAccelerator(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.Accelerator{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.AcceleratorGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(), diff --git a/pkg/controller/globalaccelerator/endpointgroup/setup.go b/pkg/controller/globalaccelerator/endpointgroup/setup.go index 6812aae2f1..743b51cb2e 100644 --- a/pkg/controller/globalaccelerator/endpointgroup/setup.go +++ b/pkg/controller/globalaccelerator/endpointgroup/setup.go @@ -19,6 +19,7 @@ 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" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupEndpointGroup adds a controller that reconciles an EndpointGroup. @@ -48,6 +49,7 @@ func SetupEndpointGroup(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.EndpointGroup{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.EndpointGroupGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/globalaccelerator/listener/setup.go b/pkg/controller/globalaccelerator/listener/setup.go index a9f80d2a42..15aa0ffe99 100644 --- a/pkg/controller/globalaccelerator/listener/setup.go +++ b/pkg/controller/globalaccelerator/listener/setup.go @@ -19,6 +19,7 @@ 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" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupListener adds a controller that reconciles Listener. @@ -47,6 +48,7 @@ func SetupListener(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.Listener{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.ListenerGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/glue/classifier/setup.go b/pkg/controller/glue/classifier/setup.go index a0b829a690..a82eb8acca 100644 --- a/pkg/controller/glue/classifier/setup.go +++ b/pkg/controller/glue/classifier/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupClassifier adds a controller that reconciles Classifier. @@ -56,6 +57,7 @@ func SetupClassifier(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/glue/connection/setup.go b/pkg/controller/glue/connection/setup.go index 5ad8166890..a2c062867b 100644 --- a/pkg/controller/glue/connection/setup.go +++ b/pkg/controller/glue/connection/setup.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -74,6 +75,7 @@ func SetupConnection(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/glue/crawler/setup.go b/pkg/controller/glue/crawler/setup.go index f4c66b403b..9cf5cea27f 100644 --- a/pkg/controller/glue/crawler/setup.go +++ b/pkg/controller/glue/crawler/setup.go @@ -44,6 +44,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -77,6 +78,7 @@ func SetupCrawler(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/glue/database/setup.go b/pkg/controller/glue/database/setup.go index 6657e27a3b..d1f7d911e9 100644 --- a/pkg/controller/glue/database/setup.go +++ b/pkg/controller/glue/database/setup.go @@ -36,6 +36,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupDatabase(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/glue/job/setup.go b/pkg/controller/glue/job/setup.go index da37b5bf31..658ec28a06 100644 --- a/pkg/controller/glue/job/setup.go +++ b/pkg/controller/glue/job/setup.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -75,6 +76,7 @@ func SetupJob(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/glue/securityconfiguration/setup.go b/pkg/controller/glue/securityconfiguration/setup.go index 4ddebc733e..8596cf390c 100644 --- a/pkg/controller/glue/securityconfiguration/setup.go +++ b/pkg/controller/glue/securityconfiguration/setup.go @@ -32,6 +32,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupSecurityConfiguration adds a controller that reconciles SecurityConfiguration. @@ -53,6 +54,7 @@ func SetupSecurityConfiguration(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/iam/accesskey/controller.go b/pkg/controller/iam/accesskey/controller.go index 62079d5c36..e98f608e6f 100644 --- a/pkg/controller/iam/accesskey/controller.go +++ b/pkg/controller/iam/accesskey/controller.go @@ -40,6 +40,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupAccessKey(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewAccessClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/iam/group/controller.go b/pkg/controller/iam/group/controller.go index fbd25bda0e..380f938da1 100644 --- a/pkg/controller/iam/group/controller.go +++ b/pkg/controller/iam/group/controller.go @@ -39,6 +39,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -62,6 +63,7 @@ func SetupGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewGroupClient}), managed.WithConnectionPublishers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/iam/grouppolicyattachment/controller.go b/pkg/controller/iam/grouppolicyattachment/controller.go index 12b4a0edb0..e69dafc7fa 100644 --- a/pkg/controller/iam/grouppolicyattachment/controller.go +++ b/pkg/controller/iam/grouppolicyattachment/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupGroupPolicyAttachment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewGroupPolicyAttachmentClient}), managed.WithConnectionPublishers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/iam/groupusermembership/controller.go b/pkg/controller/iam/groupusermembership/controller.go index 4778e2747e..e924fb281f 100644 --- a/pkg/controller/iam/groupusermembership/controller.go +++ b/pkg/controller/iam/groupusermembership/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupGroupUserMembership(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewGroupUserMembershipClient}), managed.WithConnectionPublishers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/iam/instanceprofile/setup.go b/pkg/controller/iam/instanceprofile/setup.go index 72579feb03..6de053b35b 100644 --- a/pkg/controller/iam/instanceprofile/setup.go +++ b/pkg/controller/iam/instanceprofile/setup.go @@ -34,6 +34,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iam/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupInstanceProfile adds a controller that reconciles InstanceProfile. @@ -56,6 +57,7 @@ func SetupInstanceProfile(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/iam/openidconnectprovider/controller.go b/pkg/controller/iam/openidconnectprovider/controller.go index d5c3268ae9..25ce90fb52 100644 --- a/pkg/controller/iam/openidconnectprovider/controller.go +++ b/pkg/controller/iam/openidconnectprovider/controller.go @@ -42,6 +42,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -71,6 +72,7 @@ func SetupOpenIDConnectProvider(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewOpenIDConnectProviderClient}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(), diff --git a/pkg/controller/iam/policy/controller.go b/pkg/controller/iam/policy/controller.go index d325d7e433..dd55170971 100644 --- a/pkg/controller/iam/policy/controller.go +++ b/pkg/controller/iam/policy/controller.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -70,6 +71,7 @@ func SetupPolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewPolicyClient, newSTSClientFn: iam.NewSTSClient}), managed.WithConnectionPublishers(), managed.WithInitializers(), diff --git a/pkg/controller/iam/role/controller.go b/pkg/controller/iam/role/controller.go index a4c6766914..aee469c248 100644 --- a/pkg/controller/iam/role/controller.go +++ b/pkg/controller/iam/role/controller.go @@ -39,6 +39,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -64,6 +65,7 @@ func SetupRole(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewRoleClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/iam/rolepolicyattachment/controller.go b/pkg/controller/iam/rolepolicyattachment/controller.go index 48e450ccb7..e3140a84ad 100644 --- a/pkg/controller/iam/rolepolicyattachment/controller.go +++ b/pkg/controller/iam/rolepolicyattachment/controller.go @@ -39,6 +39,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -59,6 +60,7 @@ func SetupRolePolicyAttachment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewRolePolicyAttachmentClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/iam/servicelinkedrole/setup.go b/pkg/controller/iam/servicelinkedrole/setup.go index 08771cf1bf..c82bd0bdd9 100644 --- a/pkg/controller/iam/servicelinkedrole/setup.go +++ b/pkg/controller/iam/servicelinkedrole/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/arn" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupServiceLinkedRole(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.ServiceLinkedRole{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.ServiceLinkedRoleGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithConnectionPublishers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/iam/user/controller.go b/pkg/controller/iam/user/controller.go index 06369dfbe9..1bd46e2223 100644 --- a/pkg/controller/iam/user/controller.go +++ b/pkg/controller/iam/user/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -68,6 +69,7 @@ func SetupUser(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewUserClient}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/iam/userpolicyattachment/controller.go b/pkg/controller/iam/userpolicyattachment/controller.go index 3134bdccdc..952035e9c0 100644 --- a/pkg/controller/iam/userpolicyattachment/controller.go +++ b/pkg/controller/iam/userpolicyattachment/controller.go @@ -38,6 +38,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -59,6 +60,7 @@ func SetupUserPolicyAttachment(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: iam.NewUserPolicyAttachmentClient}), managed.WithConnectionPublishers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/iot/policy/setup.go b/pkg/controller/iot/policy/setup.go index d007418615..81c1bf88d6 100644 --- a/pkg/controller/iot/policy/setup.go +++ b/pkg/controller/iot/policy/setup.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/iot/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupPolicy adds a controller that reconciles Policy. @@ -54,6 +55,7 @@ func SetupPolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/iot/thing/setup.go b/pkg/controller/iot/thing/setup.go index 0b37f1fbd3..8092837f22 100644 --- a/pkg/controller/iot/thing/setup.go +++ b/pkg/controller/iot/thing/setup.go @@ -37,6 +37,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupThing adds a controller that reconciles Thing. @@ -60,6 +61,7 @@ func SetupThing(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/kafka/cluster/setup.go b/pkg/controller/kafka/cluster/setup.go index a88c6d5437..a92c02c218 100644 --- a/pkg/controller/kafka/cluster/setup.go +++ b/pkg/controller/kafka/cluster/setup.go @@ -40,6 +40,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -87,6 +88,7 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(), diff --git a/pkg/controller/kafka/configuration/setup.go b/pkg/controller/kafka/configuration/setup.go index c90c8db2d2..e414deda3a 100644 --- a/pkg/controller/kafka/configuration/setup.go +++ b/pkg/controller/kafka/configuration/setup.go @@ -31,6 +31,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupConfiguration adds a controller that reconciles Configuration. @@ -53,6 +54,7 @@ func SetupConfiguration(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/kinesis/stream/setup.go b/pkg/controller/kinesis/stream/setup.go index 8a63a13326..2c98ab03b4 100644 --- a/pkg/controller/kinesis/stream/setup.go +++ b/pkg/controller/kinesis/stream/setup.go @@ -33,6 +33,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupStream adds a controller that reconciles Stream. @@ -57,6 +58,7 @@ func SetupStream(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/kms/alias/setup.go b/pkg/controller/kms/alias/setup.go index 402e9088bf..58298ba210 100644 --- a/pkg/controller/kms/alias/setup.go +++ b/pkg/controller/kms/alias/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAlias adds a controller that reconciles Alias. @@ -52,6 +53,7 @@ func SetupAlias(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/kms/grant/setup.go b/pkg/controller/kms/grant/setup.go index 8c0da58e05..9ab4a25cb2 100644 --- a/pkg/controller/kms/grant/setup.go +++ b/pkg/controller/kms/grant/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupGrant(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(), diff --git a/pkg/controller/kms/key/setup.go b/pkg/controller/kms/key/setup.go index 7a28e429fd..6616ec40d6 100644 --- a/pkg/controller/kms/key/setup.go +++ b/pkg/controller/kms/key/setup.go @@ -21,6 +21,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupKey adds a controller that reconciles Key. @@ -47,6 +48,7 @@ func SetupKey(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithInitializers(), diff --git a/pkg/controller/lambda/function/setup.go b/pkg/controller/lambda/function/setup.go index 7310421213..74eebaf146 100644 --- a/pkg/controller/lambda/function/setup.go +++ b/pkg/controller/lambda/function/setup.go @@ -24,6 +24,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" tagutils "github.com/crossplane-contrib/provider-aws/pkg/utils/tags" ) @@ -61,6 +62,7 @@ func SetupFunction(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/lambda/functionurlconfig/setup.go b/pkg/controller/lambda/functionurlconfig/setup.go index a82ef8128b..5f13071606 100644 --- a/pkg/controller/lambda/functionurlconfig/setup.go +++ b/pkg/controller/lambda/functionurlconfig/setup.go @@ -18,6 +18,7 @@ import ( 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" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupFunctionURL adds a controller that reconciles FunctionURLConfig. @@ -40,6 +41,7 @@ func SetupFunctionURL(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/lambda/permission/controller.go b/pkg/controller/lambda/permission/controller.go index 026f51304b..40a3090751 100644 --- a/pkg/controller/lambda/permission/controller.go +++ b/pkg/controller/lambda/permission/controller.go @@ -42,6 +42,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -63,6 +64,7 @@ func SetupPermission(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newLambdaClientFn: svcsdk.NewFromConfig}), managed.WithInitializers(&externalNameGenerator{kube: mgr.GetClient()}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/mq/broker/setup.go b/pkg/controller/mq/broker/setup.go index d0f2a08544..6869781f7e 100644 --- a/pkg/controller/mq/broker/setup.go +++ b/pkg/controller/mq/broker/setup.go @@ -25,6 +25,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/clients/mq" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupBroker adds a controller that reconciles Broker. @@ -49,6 +50,7 @@ func SetupBroker(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/mq/user/setup.go b/pkg/controller/mq/user/setup.go index f88326b8c8..86218aed5e 100644 --- a/pkg/controller/mq/user/setup.go +++ b/pkg/controller/mq/user/setup.go @@ -22,6 +22,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/clients/mq" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupUser adds a controller that reconciles User. @@ -48,6 +49,7 @@ func SetupUser(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/mwaa/environment/setup.go b/pkg/controller/mwaa/environment/setup.go index 1d4e4d80e1..283d3599f9 100644 --- a/pkg/controller/mwaa/environment/setup.go +++ b/pkg/controller/mwaa/environment/setup.go @@ -20,6 +20,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/mwaa/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -52,6 +53,7 @@ func SetupEnvironment(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/neptune/dbcluster/setup.go b/pkg/controller/neptune/dbcluster/setup.go index 71b99c748c..fe2ee9a0e2 100644 --- a/pkg/controller/neptune/dbcluster/setup.go +++ b/pkg/controller/neptune/dbcluster/setup.go @@ -34,6 +34,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) type dbClusterStatus string @@ -67,6 +68,7 @@ func SetupDBCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/opensearchservice/domain/setup.go b/pkg/controller/opensearchservice/domain/setup.go index f2ef630307..247f2cf12c 100644 --- a/pkg/controller/opensearchservice/domain/setup.go +++ b/pkg/controller/opensearchservice/domain/setup.go @@ -23,6 +23,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupDomain adds a controller that reconciles Domain. @@ -47,6 +48,7 @@ func SetupDomain(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go b/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go index c11e728be4..c056528b1c 100644 --- a/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go +++ b/pkg/controller/prometheusservice/alertmanagerdefinition/setup.go @@ -21,6 +21,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/prometheusservice/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAlertManagerDefinition adds a controller that reconciles AlertManagerDefinition. @@ -46,6 +47,7 @@ func SetupAlertManagerDefinition(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go b/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go index 0de0edc84b..17e0c88f92 100644 --- a/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go +++ b/pkg/controller/prometheusservice/rulegroupsnamespace/setup.go @@ -21,6 +21,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/prometheusservice/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupRuleGroupsNamespace adds a controller that reconciles RuleGroupsNamespace. @@ -46,6 +47,7 @@ func SetupRuleGroupsNamespace(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/prometheusservice/workspace/setup.go b/pkg/controller/prometheusservice/workspace/setup.go index 16c06dae43..7c1cdddb68 100644 --- a/pkg/controller/prometheusservice/workspace/setup.go +++ b/pkg/controller/prometheusservice/workspace/setup.go @@ -19,6 +19,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupWorkspace adds a controller that reconciles Workspace for PrometheusService. @@ -40,6 +41,7 @@ func SetupWorkspace(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/ram/resourceshare/setup.go b/pkg/controller/ram/resourceshare/setup.go index db3a460720..8abed5f635 100644 --- a/pkg/controller/ram/resourceshare/setup.go +++ b/pkg/controller/ram/resourceshare/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResourceShare adds a controller that reconciles ResourceShare. @@ -52,6 +53,7 @@ func SetupResourceShare(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/dbcluster/setup.go b/pkg/controller/rds/dbcluster/setup.go index 7ce6b2152f..cbfb893a99 100644 --- a/pkg/controller/rds/dbcluster/setup.go +++ b/pkg/controller/rds/dbcluster/setup.go @@ -30,6 +30,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // error constants @@ -68,6 +69,7 @@ func SetupDBCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/dbclusterparametergroup/setup.go b/pkg/controller/rds/dbclusterparametergroup/setup.go index 94f4e4c999..40de4a55c0 100644 --- a/pkg/controller/rds/dbclusterparametergroup/setup.go +++ b/pkg/controller/rds/dbclusterparametergroup/setup.go @@ -21,6 +21,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupDBClusterParameterGroup(mgr ctrl.Manager, o controller.Options) error } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/dbinstance/setup.go b/pkg/controller/rds/dbinstance/setup.go index 358cc396ce..bb5875f7e0 100644 --- a/pkg/controller/rds/dbinstance/setup.go +++ b/pkg/controller/rds/dbinstance/setup.go @@ -34,6 +34,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/jsonpatch" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // error constants @@ -82,6 +83,7 @@ func SetupDBInstance(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/dbinstanceroleassociation/setup.go b/pkg/controller/rds/dbinstanceroleassociation/setup.go index 6da07864f2..0c76c34a78 100644 --- a/pkg/controller/rds/dbinstanceroleassociation/setup.go +++ b/pkg/controller/rds/dbinstanceroleassociation/setup.go @@ -19,6 +19,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -42,6 +43,7 @@ func SetupDBInstanceRoleAssociation(mgr ctrl.Manager, o controller.Options) erro } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/dbparametergroup/setup.go b/pkg/controller/rds/dbparametergroup/setup.go index 6f8ad93d06..d9ce48fcc4 100644 --- a/pkg/controller/rds/dbparametergroup/setup.go +++ b/pkg/controller/rds/dbparametergroup/setup.go @@ -21,6 +21,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupDBParameterGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/globalcluster/setup.go b/pkg/controller/rds/globalcluster/setup.go index f9647103ad..612da7b9a2 100644 --- a/pkg/controller/rds/globalcluster/setup.go +++ b/pkg/controller/rds/globalcluster/setup.go @@ -17,6 +17,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/rds/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupGlobalCluster adds a controller that reconciles GlobalCluster. @@ -38,6 +39,7 @@ func SetupGlobalCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/rds/optiongroup/setup.go b/pkg/controller/rds/optiongroup/setup.go index a669753122..db670dbf3a 100644 --- a/pkg/controller/rds/optiongroup/setup.go +++ b/pkg/controller/rds/optiongroup/setup.go @@ -21,6 +21,7 @@ import ( svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/rds/utils" "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupOptionGroup adds a controller that reconciles OptionGroup. @@ -45,6 +46,7 @@ func SetupOptionGroup(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/redshift/cluster/controller.go b/pkg/controller/redshift/cluster/controller.go index e816ec5878..d4e5a95910 100644 --- a/pkg/controller/redshift/cluster/controller.go +++ b/pkg/controller/redshift/cluster/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -63,6 +64,7 @@ func SetupCluster(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: redshift.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/route53/hostedzone/controller.go b/pkg/controller/route53/hostedzone/controller.go index aadc757e90..80e3f3e0a6 100644 --- a/pkg/controller/route53/hostedzone/controller.go +++ b/pkg/controller/route53/hostedzone/controller.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupHostedZone(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: hostedzone.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/route53/resourcerecordset/controller.go b/pkg/controller/route53/resourcerecordset/controller.go index 236cdc18a7..15f533e589 100644 --- a/pkg/controller/route53/resourcerecordset/controller.go +++ b/pkg/controller/route53/resourcerecordset/controller.go @@ -39,6 +39,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupResourceRecordSet(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: resourcerecordset.NewClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithConnectionPublishers(), diff --git a/pkg/controller/route53resolver/resolverendpoint/hooks.go b/pkg/controller/route53resolver/resolverendpoint/hooks.go index 7da73ca6bb..d7c4e611da 100644 --- a/pkg/controller/route53resolver/resolverendpoint/hooks.go +++ b/pkg/controller/route53resolver/resolverendpoint/hooks.go @@ -18,6 +18,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResolverEndpoint adds a controller that reconciles ResolverEndpoints @@ -40,6 +41,7 @@ func SetupResolverEndpoint(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/route53resolver/resolverrule/hooks.go b/pkg/controller/route53resolver/resolverrule/hooks.go index aa6ed73d90..79e63f4ca8 100644 --- a/pkg/controller/route53resolver/resolverrule/hooks.go +++ b/pkg/controller/route53resolver/resolverrule/hooks.go @@ -18,6 +18,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/route53resolver/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupResolverRule adds a controller that reconciles ResolverRule @@ -40,6 +41,7 @@ func SetupResolverRule(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/route53resolver/resolverruleassociation/hooks.go b/pkg/controller/route53resolver/resolverruleassociation/hooks.go index 93d0beb2df..ed33b0149e 100644 --- a/pkg/controller/route53resolver/resolverruleassociation/hooks.go +++ b/pkg/controller/route53resolver/resolverruleassociation/hooks.go @@ -38,6 +38,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -57,6 +58,7 @@ func SetupResolverRuleAssociation(mgr ctrl.Manager, o controller.Options) error } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newRoute53ResolverClientFn: resolverruleassociation.NewRoute53ResolverClient}), managed.WithInitializers(), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/s3/bucket/bucket.go b/pkg/controller/s3/bucket/bucket.go index de6362d948..37107bf268 100644 --- a/pkg/controller/s3/bucket/bucket.go +++ b/pkg/controller/s3/bucket/bucket.go @@ -41,6 +41,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -62,6 +63,7 @@ func SetupBucket(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: s3.NewClient, logger: o.Logger.WithValues("controller", name)}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/s3/bucketpolicy/bucketpolicy.go b/pkg/controller/s3/bucketpolicy/bucketpolicy.go index 76035cb7a1..40732d7dc5 100644 --- a/pkg/controller/s3/bucketpolicy/bucketpolicy.go +++ b/pkg/controller/s3/bucketpolicy/bucketpolicy.go @@ -40,6 +40,7 @@ import ( connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -62,6 +63,7 @@ func SetupBucketPolicy(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: s3.NewBucketPolicyClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), diff --git a/pkg/controller/s3control/accesspoint/setup.go b/pkg/controller/s3control/accesspoint/setup.go index df7d9b259e..667ff25017 100644 --- a/pkg/controller/s3control/accesspoint/setup.go +++ b/pkg/controller/s3control/accesspoint/setup.go @@ -27,6 +27,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/s3control/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupAccessPoint adds a controller that reconciles Stage. @@ -46,6 +47,7 @@ func SetupAccessPoint(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.AccessPoint{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.AccessPointGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/secretsmanager/secret/setup.go b/pkg/controller/secretsmanager/secret/setup.go index 030b4170f2..a5de6ac0db 100644 --- a/pkg/controller/secretsmanager/secret/setup.go +++ b/pkg/controller/secretsmanager/secret/setup.go @@ -42,6 +42,7 @@ import ( errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" policyutils "github.com/crossplane-contrib/provider-aws/pkg/utils/policy" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -75,6 +76,7 @@ func SetupSecret(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/servicecatalog/provisionedproduct/setup.go b/pkg/controller/servicecatalog/provisionedproduct/setup.go index 6f37e5cd35..9f1aeae9e4 100644 --- a/pkg/controller/servicecatalog/provisionedproduct/setup.go +++ b/pkg/controller/servicecatalog/provisionedproduct/setup.go @@ -46,6 +46,7 @@ import ( clientset "github.com/crossplane-contrib/provider-aws/pkg/clients/servicecatalog" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -89,6 +90,7 @@ func SetupProvisionedProduct(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/servicediscovery/httpnamespace/setup.go b/pkg/controller/servicediscovery/httpnamespace/setup.go index 802873c893..1e1c9bc5fd 100644 --- a/pkg/controller/servicediscovery/httpnamespace/setup.go +++ b/pkg/controller/servicediscovery/httpnamespace/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/commonnamespace" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupHTTPNamespace adds a controller that reconciles HTTPNamespace. @@ -59,6 +60,7 @@ func SetupHTTPNamespace(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/servicediscovery/privatednsnamespace/setup.go b/pkg/controller/servicediscovery/privatednsnamespace/setup.go index abc961f5d2..fe5d1410ff 100644 --- a/pkg/controller/servicediscovery/privatednsnamespace/setup.go +++ b/pkg/controller/servicediscovery/privatednsnamespace/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/commonnamespace" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupPrivateDNSNamespace adds a controller that reconciles PrivateDNSNamespaces. @@ -59,6 +60,7 @@ func SetupPrivateDNSNamespace(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/servicediscovery/publicdnsnamespace/setup.go b/pkg/controller/servicediscovery/publicdnsnamespace/setup.go index 04728a66b7..75e0935457 100644 --- a/pkg/controller/servicediscovery/publicdnsnamespace/setup.go +++ b/pkg/controller/servicediscovery/publicdnsnamespace/setup.go @@ -35,6 +35,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/commonnamespace" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupPublicDNSNamespace adds a controller that reconciles PublicDNSNamespaces. @@ -60,6 +61,7 @@ func SetupPublicDNSNamespace(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/servicediscovery/service/setup.go b/pkg/controller/servicediscovery/service/setup.go index 0a539b1d66..d7085e1366 100644 --- a/pkg/controller/servicediscovery/service/setup.go +++ b/pkg/controller/servicediscovery/service/setup.go @@ -38,6 +38,7 @@ import ( clientsvcdk "github.com/crossplane-contrib/provider-aws/pkg/clients/servicediscovery" "github.com/crossplane-contrib/provider-aws/pkg/controller/servicediscovery/commonnamespace" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupService adds a controller that reconciles Service. @@ -67,6 +68,7 @@ func SetupService(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.Service{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.ServiceGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/sesv2/configurationset/setup.go b/pkg/controller/sesv2/configurationset/setup.go index 7a703d5ca0..daf039aa18 100644 --- a/pkg/controller/sesv2/configurationset/setup.go +++ b/pkg/controller/sesv2/configurationset/setup.go @@ -37,6 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupConfigurationSet adds a controller that reconciles SES ConfigurationSet. @@ -61,6 +62,7 @@ func SetupConfigurationSet(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.ConfigurationSet{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.ConfigurationSetGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/sesv2/emailidentity/setup.go b/pkg/controller/sesv2/emailidentity/setup.go index 2538193e27..83568244f2 100644 --- a/pkg/controller/sesv2/emailidentity/setup.go +++ b/pkg/controller/sesv2/emailidentity/setup.go @@ -37,6 +37,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" svcutils "github.com/crossplane-contrib/provider-aws/pkg/controller/sesv2/utils" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -65,6 +66,7 @@ func SetupEmailIdentity(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.EmailIdentity{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.EmailIdentityGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), diff --git a/pkg/controller/sesv2/emailtemplate/setup.go b/pkg/controller/sesv2/emailtemplate/setup.go index c8b7cfba38..ff41415889 100644 --- a/pkg/controller/sesv2/emailtemplate/setup.go +++ b/pkg/controller/sesv2/emailtemplate/setup.go @@ -30,6 +30,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sesv2/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupEmailTemplate adds a controller that reconciles SES EmailTemplate. @@ -53,6 +54,7 @@ func SetupEmailTemplate(mgr ctrl.Manager, o controller.Options) error { For(&svcapitypes.EmailTemplate{}). Complete(managed.NewReconciler(mgr, resource.ManagedKind(svcapitypes.EmailTemplateGroupVersionKind), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/sfn/activity/hooks.go b/pkg/controller/sfn/activity/hooks.go index 01479db778..6c45c0213e 100644 --- a/pkg/controller/sfn/activity/hooks.go +++ b/pkg/controller/sfn/activity/hooks.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sfn/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupActivity adds a controller that reconciles Activity. @@ -53,6 +54,7 @@ func SetupActivity(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/sfn/statemachine/hooks.go b/pkg/controller/sfn/statemachine/hooks.go index e968a95d86..40cf334f7f 100644 --- a/pkg/controller/sfn/statemachine/hooks.go +++ b/pkg/controller/sfn/statemachine/hooks.go @@ -33,6 +33,7 @@ import ( svcapitypes "github.com/crossplane-contrib/provider-aws/apis/sfn/v1alpha1" "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupStateMachine adds a controller that reconciles StateMachine. @@ -54,6 +55,7 @@ func SetupStateMachine(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithInitializers(), managed.WithPollInterval(o.PollInterval), diff --git a/pkg/controller/sns/subscription/controller.go b/pkg/controller/sns/subscription/controller.go index 8cfca6d732..224b79716b 100644 --- a/pkg/controller/sns/subscription/controller.go +++ b/pkg/controller/sns/subscription/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupSubscription(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: sns.NewSubscriptionClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(), diff --git a/pkg/controller/sns/topic/controller.go b/pkg/controller/sns/topic/controller.go index febbab4fd7..b04c38f1f3 100644 --- a/pkg/controller/sns/topic/controller.go +++ b/pkg/controller/sns/topic/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -61,6 +62,7 @@ func SetupSNSTopic(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: sns.NewTopicClient}), managed.WithReferenceResolver(managed.NewAPISimpleReferenceResolver(mgr.GetClient())), managed.WithInitializers(), diff --git a/pkg/controller/sqs/queue/controller.go b/pkg/controller/sqs/queue/controller.go index e3895024dd..3ca13ac061 100644 --- a/pkg/controller/sqs/queue/controller.go +++ b/pkg/controller/sqs/queue/controller.go @@ -40,6 +40,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" connectaws "github.com/crossplane-contrib/provider-aws/pkg/utils/connect/aws" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -64,6 +65,7 @@ func SetupQueue(mgr ctrl.Manager, o controller.Options) error { } reconcilerOpts := []managed.ReconcilerOption{ + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), newClientFn: sqs.NewClient}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/transfer/server/setup.go b/pkg/controller/transfer/server/setup.go index 5a78c9dd8b..dcdf5d2808 100644 --- a/pkg/controller/transfer/server/setup.go +++ b/pkg/controller/transfer/server/setup.go @@ -30,6 +30,7 @@ import ( "github.com/crossplane-contrib/provider-aws/apis/v1alpha1" "github.com/crossplane-contrib/provider-aws/pkg/features" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) // SetupServer adds a controller that reconciles Server. @@ -53,6 +54,7 @@ func SetupServer(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/controller/transfer/user/setup.go b/pkg/controller/transfer/user/setup.go index e855166ef6..edc5cfcfe2 100644 --- a/pkg/controller/transfer/user/setup.go +++ b/pkg/controller/transfer/user/setup.go @@ -38,6 +38,7 @@ import ( "github.com/crossplane-contrib/provider-aws/pkg/features" errorutils "github.com/crossplane-contrib/provider-aws/pkg/utils/errors" "github.com/crossplane-contrib/provider-aws/pkg/utils/pointer" + custommanaged "github.com/crossplane-contrib/provider-aws/pkg/utils/reconciler/managed" ) const ( @@ -60,6 +61,7 @@ func SetupUser(mgr ctrl.Manager, o controller.Options) error { reconcilerOpts := []managed.ReconcilerOption{ managed.WithInitializers(managed.NewNameAsExternalName(mgr.GetClient())), + managed.WithCriticalAnnotationUpdater(custommanaged.NewRetryingCriticalAnnotationUpdater(mgr.GetClient())), managed.WithExternalConnecter(&connector{kube: mgr.GetClient(), opts: opts}), managed.WithPollInterval(o.PollInterval), managed.WithLogger(o.Logger.WithValues("controller", name)), diff --git a/pkg/utils/reconciler/managed/critical_annotation_updater.go b/pkg/utils/reconciler/managed/critical_annotation_updater.go new file mode 100644 index 0000000000..ca9623d7e4 --- /dev/null +++ b/pkg/utils/reconciler/managed/critical_annotation_updater.go @@ -0,0 +1,68 @@ +/* +Copyright 2023 The Crossplane Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package managed provides a custom implementation of RetryingCriticalAnnotationUpdater +// from the crossplane-runtime package managed (github.com/crossplane/crossplane-runtime/pkg/reconciler/managed/api.go) +// This custom implementation is currently used in all controllers to revert back to the behavior before +// this breaking change from crossplane-runtime:v1.14.0 (https://github.com/crossplane/crossplane-runtime/pull/526) +// See also https://github.com/crossplane-contrib/provider-aws/pull/1953 for more information +package managed + +import ( + "context" + + "github.com/crossplane/crossplane-runtime/pkg/errors" + "github.com/crossplane/crossplane-runtime/pkg/meta" + "github.com/crossplane/crossplane-runtime/pkg/resource" + "k8s.io/apimachinery/pkg/types" + "k8s.io/client-go/util/retry" + "sigs.k8s.io/controller-runtime/pkg/client" +) + +// Error strings. +const ( + errUpdateCriticalAnnotations = "cannot update critical annotations" +) + +// A RetryingCriticalAnnotationUpdater is a CriticalAnnotationUpdater that +// retries annotation updates in the face of API server errors. +type RetryingCriticalAnnotationUpdater struct { + client client.Client +} + +// NewRetryingCriticalAnnotationUpdater returns a CriticalAnnotationUpdater that +// retries annotation updates in the face of API server errors. +func NewRetryingCriticalAnnotationUpdater(c client.Client) *RetryingCriticalAnnotationUpdater { + return &RetryingCriticalAnnotationUpdater{client: c} +} + +// UpdateCriticalAnnotations updates (i.e. persists) the annotations of the +// supplied Object. It retries in the face of any API server error several times +// in order to ensure annotations that contain critical state are persisted. Any +// pending changes to the supplied Object's spec, status, or other metadata are +// reset to their current state according to the API server. +func (u *RetryingCriticalAnnotationUpdater) UpdateCriticalAnnotations(ctx context.Context, o client.Object) error { + a := o.GetAnnotations() + err := retry.OnError(retry.DefaultRetry, resource.IsAPIError, func() error { + nn := types.NamespacedName{Name: o.GetName()} + if err := u.client.Get(ctx, nn, o); err != nil { + return err + } + meta.AddAnnotations(o, a) + return u.client.Update(ctx, o) + }) + return errors.Wrap(err, errUpdateCriticalAnnotations) +}