Skip to content

Commit 27e3ed3

Browse files
committed
add custom state ReplcaState
1 parent b53e944 commit 27e3ed3

11 files changed

+118
-138
lines changed

Diff for: apis/v1alpha1/ack-generate-metadata.yaml

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-03-14T22:49:47Z"
3-
build_hash: 0ab258c51775fd52af32e649da00d57373b20869
2+
build_date: "2025-03-20T01:38:34Z"
3+
build_hash: 61dff7feb4e499c5bae0295a63186b1f03c61e8a
44
go_version: go1.24.0
5-
version: v0.43.2-6-g0ab258c
6-
api_directory_checksum: 0d5b95bdbe63c6cfc495149b7a86440c4a5fb33a
5+
version: v0.43.2-8-g61dff7f
6+
api_directory_checksum: a6a8a54ceefd9f36c1e7605b323e7a1f7fff2d60
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 85db04e11e016a28a99058aab04767cf8345242e
10+
file_checksum: 25f1c493fb47c8eccb5a49c6ae3222cbb1010295
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

Diff for: apis/v1alpha1/generator.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ ignore:
1313
- TableDescription.TableClassSummary
1414
- CreateTableInput.ResourcePolicy
1515
- CreateTableInput.WarmThroughput
16+
custom_shapes:
17+
RepicaState:
18+
RegionName: string
19+
RegionStatus: string
20+
RegionStatusDescription: string
21+
RegionStatusPercentProgress: string
22+
RegionInaccessibleDateTime: string
1623
operations:
1724
UpdateGlobalTable:
1825
operation_type:
@@ -30,9 +37,9 @@ resources:
3037
list_of: CreateReplicationGroupMemberAction
3138
compare:
3239
is_ignored: true
33-
ReplicasDescriptions:
40+
ReplicaStates:
3441
custom_field:
35-
list_of: ReplicaDescription
42+
list_of: RepicaState
3643
is_read_only: true
3744
GlobalSecondaryIndexesDescriptions:
3845
custom_field:

Diff for: apis/v1alpha1/table.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: apis/v1alpha1/types.go

+9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: apis/v1alpha1/zz_generated.deepcopy.go

+44-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: config/crd/bases/dynamodb.services.k8s.aws_tables.yaml

+6-45
Original file line numberDiff line numberDiff line change
@@ -644,59 +644,20 @@ spec:
644644
645645
* StreamLabel
646646
type: string
647-
replicasDescriptions:
647+
replicaStates:
648648
items:
649-
description: Contains the details of the replica.
649+
description: Custom ACK type for RepicaState
650650
properties:
651-
globalSecondaryIndexes:
652-
items:
653-
description: Represents the properties of a replica global
654-
secondary index.
655-
properties:
656-
indexName:
657-
type: string
658-
provisionedThroughputOverride:
659-
description: |-
660-
Replica-specific provisioned throughput settings. If not specified, uses
661-
the source table's provisioned throughput settings.
662-
properties:
663-
readCapacityUnits:
664-
format: int64
665-
type: integer
666-
type: object
667-
type: object
668-
type: array
669-
kmsMasterKeyID:
651+
regionInaccessibleDateTime:
670652
type: string
671-
provisionedThroughputOverride:
672-
description: |-
673-
Replica-specific provisioned throughput settings. If not specified, uses
674-
the source table's provisioned throughput settings.
675-
properties:
676-
readCapacityUnits:
677-
format: int64
678-
type: integer
679-
type: object
680653
regionName:
681654
type: string
682-
replicaInaccessibleDateTime:
683-
format: date-time
684-
type: string
685-
replicaStatus:
655+
regionStatus:
686656
type: string
687-
replicaStatusDescription:
657+
regionStatusDescription:
688658
type: string
689-
replicaStatusPercentProgress:
659+
regionStatusPercentProgress:
690660
type: string
691-
replicaTableClassSummary:
692-
description: Contains details of the table class.
693-
properties:
694-
lastUpdateDateTime:
695-
format: date-time
696-
type: string
697-
tableClass:
698-
type: string
699-
type: object
700661
type: object
701662
type: array
702663
restoreSummary:

Diff for: generator.yaml

+9-2
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,13 @@ ignore:
1313
- TableDescription.TableClassSummary
1414
- CreateTableInput.ResourcePolicy
1515
- CreateTableInput.WarmThroughput
16+
custom_shapes:
17+
RepicaState:
18+
RegionName: string
19+
RegionStatus: string
20+
RegionStatusDescription: string
21+
RegionStatusPercentProgress: string
22+
RegionInaccessibleDateTime: string
1623
operations:
1724
UpdateGlobalTable:
1825
operation_type:
@@ -30,9 +37,9 @@ resources:
3037
list_of: CreateReplicationGroupMemberAction
3138
compare:
3239
is_ignored: true
33-
ReplicasDescriptions:
40+
ReplicaStates:
3441
custom_field:
35-
list_of: ReplicaDescription
42+
list_of: RepicaState
3643
is_read_only: true
3744
GlobalSecondaryIndexesDescriptions:
3845
custom_field:

Diff for: helm/crds/dynamodb.services.k8s.aws_tables.yaml

+6-45
Original file line numberDiff line numberDiff line change
@@ -648,59 +648,20 @@ spec:
648648
649649
* StreamLabel
650650
type: string
651-
replicasDescriptions:
651+
replicaStates:
652652
items:
653-
description: Contains the details of the replica.
653+
description: Custom ACK type for RepicaState
654654
properties:
655-
globalSecondaryIndexes:
656-
items:
657-
description: Represents the properties of a replica global
658-
secondary index.
659-
properties:
660-
indexName:
661-
type: string
662-
provisionedThroughputOverride:
663-
description: |-
664-
Replica-specific provisioned throughput settings. If not specified, uses
665-
the source table's provisioned throughput settings.
666-
properties:
667-
readCapacityUnits:
668-
format: int64
669-
type: integer
670-
type: object
671-
type: object
672-
type: array
673-
kmsMasterKeyID:
655+
regionInaccessibleDateTime:
674656
type: string
675-
provisionedThroughputOverride:
676-
description: |-
677-
Replica-specific provisioned throughput settings. If not specified, uses
678-
the source table's provisioned throughput settings.
679-
properties:
680-
readCapacityUnits:
681-
format: int64
682-
type: integer
683-
type: object
684657
regionName:
685658
type: string
686-
replicaInaccessibleDateTime:
687-
format: date-time
688-
type: string
689-
replicaStatus:
659+
regionStatus:
690660
type: string
691-
replicaStatusDescription:
661+
regionStatusDescription:
692662
type: string
693-
replicaStatusPercentProgress:
663+
regionStatusPercentProgress:
694664
type: string
695-
replicaTableClassSummary:
696-
description: Contains details of the table class.
697-
properties:
698-
lastUpdateDateTime:
699-
format: date-time
700-
type: string
701-
tableClass:
702-
type: string
703-
type: object
704665
type: object
705666
type: array
706667
restoreSummary:

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

+5-10
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package table
33
import (
44
"context"
55
"errors"
6+
"strings"
67

78
ackerr "github.com/aws-controllers-k8s/runtime/pkg/errors"
89
ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
@@ -243,12 +244,10 @@ func canUpdateTableReplicas(r *resource) bool {
243244
}
244245

245246
// Check if any replica is not in ACTIVE state
246-
if r.ko.Status.ReplicasDescriptions != nil {
247-
for _, replicaDesc := range r.ko.Status.ReplicasDescriptions {
248-
if replicaDesc.RegionName != nil && replicaDesc.ReplicaStatus != nil {
249-
if *replicaDesc.ReplicaStatus != string(svcsdktypes.ReplicaStatusActive) {
250-
return false
251-
}
247+
if r.ko.Status.ReplicaStates != nil {
248+
for _, replicaState := range r.ko.Status.ReplicaStates {
249+
if replicaState != nil && !strings.Contains(*replicaState.RegionStatus, string(svcsdktypes.ReplicaStatusActive)) {
250+
return false
252251
}
253252
}
254253
}
@@ -287,10 +286,6 @@ func (rm *resourceManager) syncReplicaUpdates(
287286
return requeueWaitForReplicasActive
288287
}
289288

290-
if isTableUpdating(latest) {
291-
return requeueWaitWhileUpdating
292-
}
293-
294289
input, replicasInQueue, err := rm.newUpdateTableReplicaUpdatesOneAtATimePayload(ctx, latest, desired)
295290
if err != nil {
296291
return err

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

+12-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)