Skip to content

Commit 704f743

Browse files
committed
add tests
1 parent 1cf6705 commit 704f743

18 files changed

+314
-391
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2025-08-22T20:47:49Z"
3-
build_hash: b6df33f8c7f55b234555c0b578b8de43c74771a8
4-
go_version: go1.24.5
5-
version: v0.51.0
6-
api_directory_checksum: 5a16cea62c98405d3786f1ee1aad22ff3fafc7d6
2+
build_date: "2025-08-26T23:38:30Z"
3+
build_hash: 1045a5e99038b11b0630ca2f2f69c3bae4bedba6
4+
go_version: go1.25.0
5+
version: v0.51.0-1-g1045a5e
6+
api_directory_checksum: 65127f2f0a24a801fad4e043be37857f0e6bcfb9
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 8e6d3a835f5f6a46937ced911945d641a2145303
10+
file_checksum: b94c359eb3b2085a4a332f29719424c7b4e3a62f
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -349,40 +349,22 @@ resources:
349349
type: string
350350
index: 20
351351
ServerlessCacheSnapshot:
352+
update_operation:
353+
custom_method_name: customUpdateServerlessCacheSnapshot
352354
fields:
353-
# Primary identifiers
354-
snapshotName:
355-
is_primary_key: true
356-
serverlessCacheSnapshotArn:
357-
is_read_only: true
358-
359-
# Immutable fields
360-
snapshotName:
361-
is_immutable: true
362-
serverlessCacheName:
355+
ServerlessCacheName:
363356
is_immutable: true
364357
references:
365358
resource: ServerlessCache
366-
path: Spec.serverlessCacheName
367-
368-
# Computed fields
369-
status:
370-
is_read_only: true
371-
snapshotCreationTime:
372-
is_read_only: true
373-
engineVersion:
374-
is_read_only: true
375-
cacheUsageInBytes:
376-
is_read_only: true
377-
378-
# Reference fields
359+
path: Spec.ServerlessCacheName
360+
ServerlessCacheSnapshotName:
361+
is_immutable: true
379362
kmsKeyId:
363+
is_immutable: true
380364
references:
381365
service_name: kms
382366
resource: Key
383367
path: Status.ACKResourceMetadata.ARN
384-
385-
# Configure exception handling
386368
exceptions:
387369
errors:
388370
404:
@@ -392,19 +374,30 @@ resources:
392374
- InvalidParameterValueException
393375
- ServiceLinkedRoleNotFoundFault
394376
- InvalidServerlessCacheSnapshotStateFault
395-
396-
# Configure tagging
397-
tags:
398-
ignore: false
399-
400-
# Add hooks for tag support
401377
hooks:
402378
sdk_create_post_set_output:
403379
template_path: hooks/serverless_cache_snapshot/sdk_create_post_set_output.go.tpl
404-
sdk_update_pre_build_request:
405-
template_path: hooks/serverless_cache_snapshot/sdk_update_pre_build_request.go.tpl
380+
sdk_read_many_post_set_output:
381+
template_path: hooks/serverless_cache_snapshot/sdk_read_many_post_set_output.go.tpl
406382
sdk_read_one_post_set_output:
407383
template_path: hooks/serverless_cache_snapshot/sdk_read_one_post_set_output.go.tpl
384+
sdk_update_pre_build_request:
385+
template_path: hooks/serverless_cache_snapshot/sdk_update_pre_build_request.go.tpl
386+
print:
387+
add_age_column: true
388+
add_synced_column: true
389+
order_by: index
390+
additional_columns:
391+
- name: STATUS
392+
json_path: .status.status
393+
type: string
394+
index: 10
395+
synced:
396+
when:
397+
- path: Status.Status
398+
in:
399+
- available
400+
- create_failed
408401
operations:
409402
DescribeServerlessCaches:
410403
operation_type:

apis/v1alpha1/serverless_cache_snapshot.go

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

config/crd/bases/elasticache.services.k8s.aws_serverlesscachesnapshots.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ spec:
1414
singular: serverlesscachesnapshot
1515
scope: Namespaced
1616
versions:
17-
- name: v1alpha1
17+
- additionalPrinterColumns:
18+
- jsonPath: .status.status
19+
name: STATUS
20+
type: string
21+
- jsonPath: .status.conditions[?(@.type=="ACK.ResourceSynced")].status
22+
name: Synced
23+
type: string
24+
- jsonPath: .metadata.creationTimestamp
25+
name: Age
26+
type: date
27+
name: v1alpha1
1828
schema:
1929
openAPIV3Schema:
2030
description: ServerlessCacheSnapshot is the Schema for the ServerlessCacheSnapshots
@@ -49,6 +59,9 @@ spec:
4959
The ID of the KMS key used to encrypt the snapshot. Available for Valkey,
5060
Redis OSS and Serverless Memcached only. Default: NULL
5161
type: string
62+
x-kubernetes-validations:
63+
- message: Value is immutable once set
64+
rule: self == oldSelf
5265
kmsKeyRef:
5366
description: "AWSResourceReferenceWrapper provides a wrapper around
5467
*AWSResourceReference\ntype to provide more user friendly syntax
@@ -97,6 +110,9 @@ spec:
97110
account. Available for Valkey, Redis OSS and Serverless Memcached only. Must
98111
be between 1 and 255 characters.
99112
type: string
113+
x-kubernetes-validations:
114+
- message: Value is immutable once set
115+
rule: self == oldSelf
100116
tags:
101117
description: |-
102118
A list of tags to be added to the snapshot resource. A tag is a key-value

generator.yaml

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -349,40 +349,22 @@ resources:
349349
type: string
350350
index: 20
351351
ServerlessCacheSnapshot:
352+
update_operation:
353+
custom_method_name: customUpdateServerlessCacheSnapshot
352354
fields:
353-
# Primary identifiers
354-
snapshotName:
355-
is_primary_key: true
356-
serverlessCacheSnapshotArn:
357-
is_read_only: true
358-
359-
# Immutable fields
360-
snapshotName:
361-
is_immutable: true
362-
serverlessCacheName:
355+
ServerlessCacheName:
363356
is_immutable: true
364357
references:
365358
resource: ServerlessCache
366-
path: Spec.serverlessCacheName
367-
368-
# Computed fields
369-
status:
370-
is_read_only: true
371-
snapshotCreationTime:
372-
is_read_only: true
373-
engineVersion:
374-
is_read_only: true
375-
cacheUsageInBytes:
376-
is_read_only: true
377-
378-
# Reference fields
359+
path: Spec.ServerlessCacheName
360+
ServerlessCacheSnapshotName:
361+
is_immutable: true
379362
kmsKeyId:
363+
is_immutable: true
380364
references:
381365
service_name: kms
382366
resource: Key
383367
path: Status.ACKResourceMetadata.ARN
384-
385-
# Configure exception handling
386368
exceptions:
387369
errors:
388370
404:
@@ -392,19 +374,30 @@ resources:
392374
- InvalidParameterValueException
393375
- ServiceLinkedRoleNotFoundFault
394376
- InvalidServerlessCacheSnapshotStateFault
395-
396-
# Configure tagging
397-
tags:
398-
ignore: false
399-
400-
# Add hooks for tag support
401377
hooks:
402378
sdk_create_post_set_output:
403379
template_path: hooks/serverless_cache_snapshot/sdk_create_post_set_output.go.tpl
404-
sdk_update_pre_build_request:
405-
template_path: hooks/serverless_cache_snapshot/sdk_update_pre_build_request.go.tpl
380+
sdk_read_many_post_set_output:
381+
template_path: hooks/serverless_cache_snapshot/sdk_read_many_post_set_output.go.tpl
406382
sdk_read_one_post_set_output:
407383
template_path: hooks/serverless_cache_snapshot/sdk_read_one_post_set_output.go.tpl
384+
sdk_update_pre_build_request:
385+
template_path: hooks/serverless_cache_snapshot/sdk_update_pre_build_request.go.tpl
386+
print:
387+
add_age_column: true
388+
add_synced_column: true
389+
order_by: index
390+
additional_columns:
391+
- name: STATUS
392+
json_path: .status.status
393+
type: string
394+
index: 10
395+
synced:
396+
when:
397+
- path: Status.Status
398+
in:
399+
- available
400+
- create_failed
408401
operations:
409402
DescribeServerlessCaches:
410403
operation_type:

go.mod

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ toolchain go1.24.1
66

77
require (
88
github.com/aws-controllers-k8s/ec2-controller v1.0.7
9+
github.com/aws-controllers-k8s/kms-controller v1.0.2
910
github.com/aws-controllers-k8s/runtime v0.51.0
1011
github.com/aws-controllers-k8s/sns-controller v1.0.11
1112
github.com/aws/aws-sdk-go v1.49.0
@@ -15,7 +16,6 @@ require (
1516
github.com/go-logr/logr v1.4.2
1617
github.com/pkg/errors v0.9.1
1718
github.com/spf13/pflag v1.0.5
18-
github.com/stretchr/testify v1.9.0
1919
k8s.io/api v0.32.1
2020
k8s.io/apimachinery v0.32.1
2121
k8s.io/client-go v0.32.1
@@ -56,20 +56,17 @@ require (
5656
github.com/itchyny/gojq v0.12.6 // indirect
5757
github.com/itchyny/timefmt-go v0.1.3 // indirect
5858
github.com/jaypipes/envutil v1.0.0 // indirect
59-
github.com/jmespath/go-jmespath v0.4.0 // indirect
6059
github.com/josharian/intern v1.0.0 // indirect
6160
github.com/json-iterator/go v1.1.12 // indirect
6261
github.com/mailru/easyjson v0.7.7 // indirect
6362
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
6463
github.com/modern-go/reflect2 v1.0.2 // indirect
6564
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
66-
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
6765
github.com/prometheus/client_golang v1.19.1 // indirect
6866
github.com/prometheus/client_model v0.6.1 // indirect
6967
github.com/prometheus/common v0.55.0 // indirect
7068
github.com/prometheus/procfs v0.15.1 // indirect
7169
github.com/samber/lo v1.37.0 // indirect
72-
github.com/stretchr/objx v0.5.2 // indirect
7370
github.com/x448/float16 v0.8.4 // indirect
7471
go.uber.org/multierr v1.11.0 // indirect
7572
go.uber.org/zap v1.27.0 // indirect

go.sum

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
github.com/aws-controllers-k8s/ec2-controller v1.0.7 h1:7MDu2bq8NFKbgzzgHYPFRT7bf+SmTchgWuq8ixKK0Jc=
22
github.com/aws-controllers-k8s/ec2-controller v1.0.7/go.mod h1:PvsQehgncHgcu9FiY13M45+GkVsKI98g7G83SrgH7vY=
3+
github.com/aws-controllers-k8s/kms-controller v1.0.2 h1:v8nh/oaX/U6spCwBDaWyem7XXpzoP/MnkJyEjNOZN9s=
4+
github.com/aws-controllers-k8s/kms-controller v1.0.2/go.mod h1:BeoijsyGjJ9G5VcDjpFdxBW0IxaeKXYX497XmUJiPSQ=
35
github.com/aws-controllers-k8s/runtime v0.51.0 h1:ZKu1DXPG7+CsvbEPLMCGqWFdfK37kSbceLzYf9lRZbw=
46
github.com/aws-controllers-k8s/runtime v0.51.0/go.mod h1:OkUJN+Ds799JLYZsMJrO2vDJ4snxUeHK2MgrQHbU+Qc=
57
github.com/aws-controllers-k8s/sns-controller v1.0.11 h1:nnkywTHzO64y7RrrfoPNyYf1TOkkQHtlg+S0jEPKUZ8=
@@ -96,8 +98,6 @@ github.com/jaypipes/envutil v1.0.0 h1:u6Vwy9HwruFihoZrL0bxDLCa/YNadGVwKyPElNmZWo
9698
github.com/jaypipes/envutil v1.0.0/go.mod h1:vgIRDly+xgBq0eeZRcflOHMMobMwgC6MkMbxo/Nw65M=
9799
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
98100
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
99-
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
100-
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
101101
github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8HmY=
102102
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
103103
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
@@ -222,9 +222,6 @@ gopkg.in/evanphx/json-patch.v4 v4.12.0 h1:n6jtcsulIzXPJaxegRbvFNNrZDjbij7ny3gmSP
222222
gopkg.in/evanphx/json-patch.v4 v4.12.0/go.mod h1:p8EYWUEYMpynmqDbY58zCKCFZw8pRWMG4EsWvDvM72M=
223223
gopkg.in/inf.v0 v0.9.1 h1:73M5CoZyi3ZLMOyDlQh031Cx6N9NDJ2Vvfl76EDAgDc=
224224
gopkg.in/inf.v0 v0.9.1/go.mod h1:cWUDdTG/fYaXco+Dcufb5Vnc6Gp2YChqWtbxRZE0mXw=
225-
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
226-
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
227-
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
228225
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
229226
gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
230227
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=

helm/crds/elasticache.services.k8s.aws_serverlesscachesnapshots.yaml

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,17 @@ spec:
1414
singular: serverlesscachesnapshot
1515
scope: Namespaced
1616
versions:
17-
- name: v1alpha1
17+
- additionalPrinterColumns:
18+
- jsonPath: .status.status
19+
name: STATUS
20+
type: string
21+
- jsonPath: .status.conditions[?(@.type=="ACK.ResourceSynced")].status
22+
name: Synced
23+
type: string
24+
- jsonPath: .metadata.creationTimestamp
25+
name: Age
26+
type: date
27+
name: v1alpha1
1828
schema:
1929
openAPIV3Schema:
2030
description: ServerlessCacheSnapshot is the Schema for the ServerlessCacheSnapshots
@@ -49,6 +59,9 @@ spec:
4959
The ID of the KMS key used to encrypt the snapshot. Available for Valkey,
5060
Redis OSS and Serverless Memcached only. Default: NULL
5161
type: string
62+
x-kubernetes-validations:
63+
- message: Value is immutable once set
64+
rule: self == oldSelf
5265
kmsKeyRef:
5366
description: "AWSResourceReferenceWrapper provides a wrapper around
5467
*AWSResourceReference\ntype to provide more user friendly syntax
@@ -97,6 +110,9 @@ spec:
97110
account. Available for Valkey, Redis OSS and Serverless Memcached only. Must
98111
be between 1 and 255 characters.
99112
type: string
113+
x-kubernetes-validations:
114+
- message: Value is immutable once set
115+
rule: self == oldSelf
100116
tags:
101117
description: |-
102118
A list of tags to be added to the snapshot resource. A tag is a key-value

helm/values.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
image:
66
repository: public.ecr.aws/aws-controllers-k8s/elasticache-controller
77
tag: 1.2.1
8+
pullPolicy: IfNotPresent
89
pullSecrets: []
910

1011
nameOverride: ""

0 commit comments

Comments
 (0)