From a479ff96b83974aa7c8fdf32dd436d969521b879 Mon Sep 17 00:00:00 2001 From: kelvinwijaya Date: Tue, 1 Aug 2023 22:44:19 +0800 Subject: [PATCH] fix(dynamodb): Update Input with external-name for isUpToDate and postUpdate functions Signed-off-by: kelvinwijaya --- pkg/controller/dynamodb/table/hooks.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/controller/dynamodb/table/hooks.go b/pkg/controller/dynamodb/table/hooks.go index 86fa12b604..0b548eb275 100644 --- a/pkg/controller/dynamodb/table/hooks.go +++ b/pkg/controller/dynamodb/table/hooks.go @@ -87,7 +87,7 @@ func SetupTable(mgr ctrl.Manager, o controller.Options) error { func (e *updateClient) postUpdate(_ context.Context, cr *svcapitypes.Table, obj *svcsdk.UpdateTableOutput, _ managed.ExternalUpdate, _ error) (managed.ExternalUpdate, error) { cbresult, err := e.client.DescribeContinuousBackups(&svcsdk.DescribeContinuousBackupsInput{ - TableName: aws.String(cr.Name), + TableName: aws.String(meta.GetExternalName(cr)), }) if err != nil { return managed.ExternalUpdate{}, err @@ -99,7 +99,7 @@ func (e *updateClient) postUpdate(_ context.Context, cr *svcapitypes.Table, obj pitrSpecEnabled := pointer.BoolDeref(cr.Spec.ForProvider.PointInTimeRecoveryEnabled, false) pitrInput := &svcsdk.UpdateContinuousBackupsInput{ - TableName: aws.String(cr.Name), + TableName: aws.String(meta.GetExternalName(cr)), PointInTimeRecoverySpecification: (&svcsdk.PointInTimeRecoverySpecification{ PointInTimeRecoveryEnabled: &pitrSpecEnabled, }), @@ -425,7 +425,7 @@ func (e *updateClient) isUpToDate(cr *svcapitypes.Table, resp *svcsdk.DescribeTa // point in time recovery status cbresult, err := e.client.DescribeContinuousBackups(&svcsdk.DescribeContinuousBackupsInput{ - TableName: aws.String(cr.Name), + TableName: aws.String(meta.GetExternalName(cr)), }) if err != nil { return false, err