Skip to content

make tableReplica a no-op field #124

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apis/v1alpha1/ack-generate-metadata.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ack_generate_info:
build_date: "2025-03-24T15:20:40Z"
build_date: "2025-03-27T18:00:37Z"
build_hash: 3722729cebe6d3c03c7e442655ef0846f91566a2
go_version: go1.24.0
go_version: go1.24.1
version: v0.43.2-7-g3722729
api_directory_checksum: cb49386ebd7bb50e2521072a76262c72b9dbd285
api_version: v1alpha1
Expand Down
39 changes: 19 additions & 20 deletions pkg/resource/table/hooks.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ package table

import (
"context"
"errors"
"fmt"
"strings"
"time"
Expand Down Expand Up @@ -233,17 +232,17 @@ func (rm *resourceManager) customUpdateTable(
}
return nil, err
}
case delta.DifferentAt("Spec.TableReplicas"):
// Enabling replicas required streams enabled and StreamViewType to be NEW_AND_OLD_IMAGES
// Version 2019.11.21 TableUpdate API requirement
if !hasStreamSpecificationWithNewAndOldImages(desired) {
msg := "table must have DynamoDB Streams enabled with StreamViewType set to NEW_AND_OLD_IMAGES for replica updates"
rlog.Debug(msg)
return nil, ackerr.NewTerminalError(errors.New(msg))
}
if err := rm.syncReplicas(ctx, latest, desired); err != nil {
return nil, err
}
// case delta.DifferentAt("Spec.TableReplicas"):
// // Enabling replicas required streams enabled and StreamViewType to be NEW_AND_OLD_IMAGES
// // Version 2019.11.21 TableUpdate API requirement
// if !hasStreamSpecificationWithNewAndOldImages(desired) {
// msg := "table must have DynamoDB Streams enabled with StreamViewType set to NEW_AND_OLD_IMAGES for replica updates"
// rlog.Debug(msg)
// return nil, ackerr.NewTerminalError(errors.New(msg))
// }
// if err := rm.syncReplicas(ctx, latest, desired); err != nil {
// return nil, err
// }
}
}

Expand Down Expand Up @@ -578,14 +577,14 @@ func customPreCompare(
}
}

// Handle ReplicaUpdates API comparison
if len(a.ko.Spec.TableReplicas) != len(b.ko.Spec.TableReplicas) {
delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
} else if a.ko.Spec.TableReplicas != nil && b.ko.Spec.TableReplicas != nil {
if !equalReplicaArrays(a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas) {
delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
}
}
// // Handle ReplicaUpdates API comparison
// if len(a.ko.Spec.TableReplicas) != len(b.ko.Spec.TableReplicas) {
// delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
// } else if a.ko.Spec.TableReplicas != nil && b.ko.Spec.TableReplicas != nil {
// if !equalReplicaArrays(a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas) {
// delta.Add("Spec.TableReplicas", a.ko.Spec.TableReplicas, b.ko.Spec.TableReplicas)
// }
// }

if a.ko.Spec.DeletionProtectionEnabled == nil {
a.ko.Spec.DeletionProtectionEnabled = aws.Bool(false)
Expand Down
Loading