Skip to content

Commit ca89ad3

Browse files
committed
add tests
1 parent 3cc1a09 commit ca89ad3

15 files changed

+456
-50
lines changed
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-03-12T23:25:20Z"
3-
build_hash: 5645e51ed3c413f616e1b929f1527a5139c44198
2+
build_date: "2025-03-14T22:49:47Z"
3+
build_hash: 0ab258c51775fd52af32e649da00d57373b20869
44
go_version: go1.24.0
5-
version: v0.43.2-3-g5645e51
5+
version: v0.43.2-6-g0ab258c
66
api_directory_checksum: 0d5b95bdbe63c6cfc495149b7a86440c4a5fb33a
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 48323d41b9cb7ade08c8a87367846cccdd1f6409
10+
file_checksum: 85db04e11e016a28a99058aab04767cf8345242e
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ resources:
8080
code: ResourceNotFoundException
8181
terminal_codes:
8282
- InvalidParameter
83+
- ValidationException
8384
update_operation:
8485
custom_method_name: customUpdateTable
8586
hooks:

generator.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ resources:
8080
code: ResourceNotFoundException
8181
terminal_codes:
8282
- InvalidParameter
83+
- ValidationException
8384
update_operation:
8485
custom_method_name: customUpdateTable
8586
hooks:

pkg/resource/table/hooks.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ var (
7878
)
7979
requeueWaitWhileUpdating = ackrequeue.NeededAfter(
8080
ErrTableUpdating,
81-
5*time.Second,
81+
10*time.Second,
8282
)
8383
requeueWaitGSIReady = ackrequeue.NeededAfter(
8484
ErrTableGSIsUpdating,

pkg/resource/table/hooks_replica_updates.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ import (
77
ackerr "github.com/aws-controllers-k8s/runtime/pkg/errors"
88
ackrtlog "github.com/aws-controllers-k8s/runtime/pkg/runtime/log"
99

10-
"github.com/aws/aws-sdk-go-v2/aws"
1110
"github.com/aws-controllers-k8s/dynamodb-controller/apis/v1alpha1"
11+
"github.com/aws/aws-sdk-go-v2/aws"
1212
svcsdk "github.com/aws/aws-sdk-go-v2/service/dynamodb"
1313
svcsdktypes "github.com/aws/aws-sdk-go-v2/service/dynamodb/types"
1414
)

pkg/resource/table/manager.go

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/table/sdk.go

Lines changed: 2 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/resource/table/tags.go

Lines changed: 28 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

templates/hooks/table/sdk_create_post_set_output.go.tpl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
}
66
// Check if replicas were specified during creation
77
if desired.ko.Spec.Replicas != nil && len(desired.ko.Spec.Replicas) > 0 {
8-
// Copy the replica configuration to the new resource
98
ko.Spec.Replicas = desired.ko.Spec.Replicas
109
1110
// Return with a requeue to process replica updates

templates/hooks/table/sdk_delete_pre_build_request.go.tpl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,13 @@
77

88
// If there are replicas, we need to remove them before deleting the table
99
if r.ko.Spec.Replicas != nil && len(r.ko.Spec.Replicas) > 0 {
10-
// Create a desired state with no replicas
1110
desired := &resource{
1211
ko: r.ko.DeepCopy(),
1312
}
1413
desired.ko.Spec.Replicas = nil
1514

16-
// Call syncReplicaUpdates to remove all replicas
1715
err := rm.syncReplicaUpdates(ctx, r, desired)
1816
if err != nil {
19-
if err == requeueWaitWhileUpdating {
20-
// This is expected - we need to wait for the replica removal to complete
21-
return nil, err
22-
}
2317
return nil, err
2418
}
2519
}

0 commit comments

Comments
 (0)