Skip to content

Commit 7b6a0d0

Browse files
committed
Revert "Add TableReplicas Support for DynamoDB Table Replicas (aws-controllers-k8s#120)
This reverts commit 755ecd8. Ensure we keep the field in helm
1 parent 11a5690 commit 7b6a0d0

12 files changed

+29
-1171
lines changed

Diff for: pkg/resource/table/hooks.go

+5-34
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ package table
1515

1616
import (
1717
"context"
18-
"errors"
1918
"fmt"
2019
"strings"
2120
"time"
@@ -35,25 +34,21 @@ import (
3534

3635
var (
3736
ErrTableDeleting = fmt.Errorf(
38-
"table in '%v' state, cannot be modified or deleted",
37+
"Table in '%v' state, cannot be modified or deleted",
3938
svcsdktypes.TableStatusDeleting,
4039
)
4140
ErrTableCreating = fmt.Errorf(
42-
"table in '%v' state, cannot be modified or deleted",
41+
"Table in '%v' state, cannot be modified or deleted",
4342
svcsdktypes.TableStatusCreating,
4443
)
4544
ErrTableUpdating = fmt.Errorf(
46-
"table in '%v' state, cannot be modified or deleted",
45+
"Table in '%v' state, cannot be modified or deleted",
4746
svcsdktypes.TableStatusUpdating,
4847
)
4948
ErrTableGSIsUpdating = fmt.Errorf(
50-
"table GSIs in '%v' state, cannot be modified or deleted",
49+
"Table GSIs in '%v' state, cannot be modified or deleted",
5150
svcsdktypes.IndexStatusCreating,
5251
)
53-
ErrTableReplicasUpdating = fmt.Errorf(
54-
"table replica in '%v' state, cannot be modified or deleted",
55-
svcsdktypes.ReplicaStatusUpdating,
56-
)
5752
)
5853

5954
// TerminalStatuses are the status strings that are terminal states for a
@@ -79,16 +74,12 @@ var (
7974
)
8075
requeueWaitWhileUpdating = ackrequeue.NeededAfter(
8176
ErrTableUpdating,
82-
10*time.Second,
77+
5*time.Second,
8378
)
8479
requeueWaitGSIReady = ackrequeue.NeededAfter(
8580
ErrTableGSIsUpdating,
8681
10*time.Second,
8782
)
88-
requeueWaitReplicasActive = ackrequeue.NeededAfter(
89-
ErrTableReplicasUpdating,
90-
10*time.Second,
91-
)
9283
)
9384

9485
// tableHasTerminalStatus returns whether the supplied Dynamodb table is in a
@@ -233,17 +224,6 @@ func (rm *resourceManager) customUpdateTable(
233224
}
234225
return nil, err
235226
}
236-
case delta.DifferentAt("Spec.TableReplicas"):
237-
// Enabling replicas required streams enabled and StreamViewType to be NEW_AND_OLD_IMAGES
238-
// Version 2019.11.21 TableUpdate API requirement
239-
if !hasStreamSpecificationWithNewAndOldImages(desired) {
240-
msg := "table must have DynamoDB Streams enabled with StreamViewType set to NEW_AND_OLD_IMAGES for replica updates"
241-
rlog.Debug(msg)
242-
return nil, ackerr.NewTerminalError(errors.New(msg))
243-
}
244-
if err := rm.syncReplicas(ctx, latest, desired); err != nil {
245-
return nil, err
246-
}
247227
}
248228
}
249229

@@ -578,15 +558,6 @@ func customPreCompare(
578558
}
579559
}
580560

581-
// Handle ReplicaUpdates API comparison
582-
if len(a.ko.Spec.TableReplicas) != len(b.ko.Spec.TableReplicas) {
583-
delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
584-
} else if a.ko.Spec.TableReplicas != nil && b.ko.Spec.TableReplicas != nil {
585-
if !equalReplicaArrays(a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas) {
586-
delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
587-
}
588-
}
589-
590561
if a.ko.Spec.DeletionProtectionEnabled == nil {
591562
a.ko.Spec.DeletionProtectionEnabled = aws.Bool(false)
592563
}

0 commit comments

Comments
 (0)