Skip to content

Commit db8b7fa

Browse files
committed
add tests
1 parent 1cf6705 commit db8b7fa

18 files changed

+326
-403
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-26T22:49:53Z"
3+
build_hash: 1045a5e99038b11b0630ca2f2f69c3bae4bedba6
4+
go_version: go1.25.0
5+
version: v0.51.0-1-g1045a5e
6+
api_directory_checksum: b27a72b34e1f4d1cb5876f6887c3a56d8f800d19
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 8e6d3a835f5f6a46937ced911945d641a2145303
10+
file_checksum: 79aad3cfe3600db2452d2e228dce9753ecee7af4
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 28 additions & 37 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,28 @@ 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:
402-
sdk_create_post_set_output:
403-
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
406-
sdk_read_one_post_set_output:
407-
template_path: hooks/serverless_cache_snapshot/sdk_read_one_post_set_output.go.tpl
378+
sdk_read_many_post_set_output:
379+
template_path: hooks/serverless_cache_snapshot/sdk_read_many_post_set_output.go.tpl
380+
print:
381+
add_age_column: true
382+
add_synced_column: true
383+
order_by: index
384+
additional_columns:
385+
- name: STATUS
386+
json_path: .status.status
387+
type: string
388+
index: 10
389+
- name: ENDPOINT
390+
json_path: .status.endpoint.address
391+
type: string
392+
index: 20
393+
synced:
394+
when:
395+
- path: Status.Status
396+
in:
397+
- available
398+
- create_failed
408399
operations:
409400
DescribeServerlessCaches:
410401
operation_type:

apis/v1alpha1/serverless_cache_snapshot.go

Lines changed: 6 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: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ 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.endpoint.address
22+
name: ENDPOINT
23+
type: string
24+
- jsonPath: .status.conditions[?(@.type=="ACK.ResourceSynced")].status
25+
name: Synced
26+
type: string
27+
- jsonPath: .metadata.creationTimestamp
28+
name: Age
29+
type: date
30+
name: v1alpha1
1831
schema:
1932
openAPIV3Schema:
2033
description: ServerlessCacheSnapshot is the Schema for the ServerlessCacheSnapshots
@@ -49,6 +62,9 @@ spec:
4962
The ID of the KMS key used to encrypt the snapshot. Available for Valkey,
5063
Redis OSS and Serverless Memcached only. Default: NULL
5164
type: string
65+
x-kubernetes-validations:
66+
- message: Value is immutable once set
67+
rule: self == oldSelf
5268
kmsKeyRef:
5369
description: "AWSResourceReferenceWrapper provides a wrapper around
5470
*AWSResourceReference\ntype to provide more user friendly syntax
@@ -97,6 +113,9 @@ spec:
97113
account. Available for Valkey, Redis OSS and Serverless Memcached only. Must
98114
be between 1 and 255 characters.
99115
type: string
116+
x-kubernetes-validations:
117+
- message: Value is immutable once set
118+
rule: self == oldSelf
100119
tags:
101120
description: |-
102121
A list of tags to be added to the snapshot resource. A tag is a key-value

generator.yaml

Lines changed: 28 additions & 37 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,28 @@ 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:
402-
sdk_create_post_set_output:
403-
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
406-
sdk_read_one_post_set_output:
407-
template_path: hooks/serverless_cache_snapshot/sdk_read_one_post_set_output.go.tpl
378+
sdk_read_many_post_set_output:
379+
template_path: hooks/serverless_cache_snapshot/sdk_read_many_post_set_output.go.tpl
380+
print:
381+
add_age_column: true
382+
add_synced_column: true
383+
order_by: index
384+
additional_columns:
385+
- name: STATUS
386+
json_path: .status.status
387+
type: string
388+
index: 10
389+
- name: ENDPOINT
390+
json_path: .status.endpoint.address
391+
type: string
392+
index: 20
393+
synced:
394+
when:
395+
- path: Status.Status
396+
in:
397+
- available
398+
- create_failed
408399
operations:
409400
DescribeServerlessCaches:
410401
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: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,20 @@ 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.endpoint.address
22+
name: ENDPOINT
23+
type: string
24+
- jsonPath: .status.conditions[?(@.type=="ACK.ResourceSynced")].status
25+
name: Synced
26+
type: string
27+
- jsonPath: .metadata.creationTimestamp
28+
name: Age
29+
type: date
30+
name: v1alpha1
1831
schema:
1932
openAPIV3Schema:
2033
description: ServerlessCacheSnapshot is the Schema for the ServerlessCacheSnapshots
@@ -49,6 +62,9 @@ spec:
4962
The ID of the KMS key used to encrypt the snapshot. Available for Valkey,
5063
Redis OSS and Serverless Memcached only. Default: NULL
5164
type: string
65+
x-kubernetes-validations:
66+
- message: Value is immutable once set
67+
rule: self == oldSelf
5268
kmsKeyRef:
5369
description: "AWSResourceReferenceWrapper provides a wrapper around
5470
*AWSResourceReference\ntype to provide more user friendly syntax
@@ -97,6 +113,9 @@ spec:
97113
account. Available for Valkey, Redis OSS and Serverless Memcached only. Must
98114
be between 1 and 255 characters.
99115
type: string
116+
x-kubernetes-validations:
117+
- message: Value is immutable once set
118+
rule: self == oldSelf
100119
tags:
101120
description: |-
102121
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)