Skip to content

Commit 69ddd82

Browse files
committed
Support for CacheCluster resource
This changelist adds support for the ElastiCache `CacheCluster` resource. The generated code did not account for many fields in the call to `ModifyCacheCluster`, and the `DescribeCacheClusters` API does not return all fields in the spec and values for some fields are reported in the `PendingModifiedValues` field instead. To handle this, the last requested configuration for `Spec.PreferredAvailabilityZones` is stored as annotations and used to compute `NewAvailabilityZones`. Moreover, `CacheNodeIdsToRemove` is computed using `Spec.NumCacheNodes` and `PendingModifiedValues.NumCacheNodes`. Support for `Spec.LogDeliveryConfigurations` is explicitly removed and parked for later because the Describe API does not return all fields for this struct. There were many changes to other ElastiCache resources introduced in the newer SDK, so they have been removed for now and not ignored. As a result, a subsequent `make build-controller` will result in new changes. The logic for syncing tags and comparing engine versions has been refactored to promote reusability. Closes aws-controllers-k8s/community#2079. Signed-off-by: cPu1 <[email protected]>
1 parent 63b9491 commit 69ddd82

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+7360
-289
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: "2024-05-02T20:54:33Z"
2+
build_date: "2024-06-27T15:44:05Z"
33
build_hash: 14cef51778d471698018b6c38b604181a6948248
4-
go_version: go1.22.0
4+
go_version: go1.22.2
55
version: v0.34.0
6-
api_directory_checksum: bd34f72147706f1dbc990acf4a6c4f6615c1bddb
6+
api_directory_checksum: 72ee568321fc3effa026fe218a7e34f0e242aeeb
77
api_version: v1alpha1
8-
aws_sdk_go_version: v1.44.93
8+
aws_sdk_go_version: v1.49.0
99
generator_config_info:
10-
file_checksum: 3f88502d4b7623890c8eff789285f98fa3d84553
10+
file_checksum: 4f11f2467e458e3dfd846ce896c7e84d69e56ee0
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

Diff for: apis/v1alpha1/cache_cluster.go

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

Diff for: apis/v1alpha1/enums.go

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

Diff for: apis/v1alpha1/generator.yaml

+94-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,88 @@
11
resources:
2+
CacheCluster:
3+
fields:
4+
CacheSubnetGroupName:
5+
references:
6+
resource: CacheSubnetGroup
7+
path: Spec.CacheSubnetGroupName
8+
CacheParameterGroupName:
9+
references:
10+
resource: CacheParameterGroup
11+
path: Spec.CacheParameterGroupName
12+
ReplicationGroupID:
13+
references:
14+
resource: ReplicationGroup
15+
path: Spec.ReplicationGroupID
16+
is_immutable: true
17+
SnapshotName:
18+
references:
19+
resource: Snapshot
20+
path: Spec.SnapshotName
21+
is_immutable: true
22+
NotificationTopicARN:
23+
references:
24+
service_name: sns
25+
resource: Topic
26+
path: Status.ACKResourceMetadata.ARN
27+
AuthToken:
28+
is_secret: true
29+
PreferredAvailabilityZone:
30+
late_initialize: {}
31+
PreferredAvailabilityZones:
32+
compare:
33+
is_ignored: true
34+
print:
35+
add_age_column: true
36+
add_synced_column: true
37+
order_by: index
38+
additional_columns:
39+
- name: VERSION
40+
json_path: .spec.engineVersion
41+
type: string
42+
index: 10
43+
- name: STATUS
44+
json_path: .status.cacheClusterStatus
45+
type: string
46+
index: 20
47+
- name: ENDPOINT
48+
json_path: .status.configurationEndpoint.address
49+
type: string
50+
index: 30
51+
priority: 1
52+
exceptions:
53+
errors:
54+
404:
55+
code: CacheClusterNotFound
56+
terminal_codes:
57+
- ReplicationGroupNotFoundFault
58+
- InvalidReplicationGroupStateFault
59+
- CacheClusterAlreadyExistsFault
60+
- InsufficientCacheClusterCapacityFault
61+
- CacheSecurityGroupNotFoundFault
62+
- CacheSubnetGroupNotFoundFault
63+
- ClusterQuotaForCustomerExceededFault
64+
- NodeQuotaForClusterExceededFault
65+
- NodeQuotaForCustomerExceededFault
66+
- CacheParameterGroupNotFoundFault
67+
- InvalidVPCNetworkStateFault
68+
- TagQuotaPerResource
69+
- InvalidParameterValue
70+
- InvalidParameterCombination
71+
hooks:
72+
sdk_create_post_set_output:
73+
template_path: hooks/cache_cluster/sdk_create_post_set_output.go.tpl
74+
sdk_delete_pre_build_request:
75+
template_path: hooks/cache_cluster/sdk_delete_pre_build_request.go.tpl
76+
sdk_read_many_post_set_output:
77+
template_path: hooks/cache_cluster/sdk_read_many_post_set_output.go.tpl
78+
sdk_update_pre_build_request:
79+
template_path: hooks/cache_cluster/sdk_update_pre_build_request.go.tpl
80+
sdk_update_post_build_request:
81+
template_path: hooks/cache_cluster/sdk_update_post_build_request.go.tpl
82+
sdk_update_post_set_output:
83+
template_path: hooks/cache_cluster/sdk_update_post_set_output.go.tpl
84+
delta_post_compare:
85+
code: "modifyDelta(delta, a, b)"
286
CacheSubnetGroup:
387
exceptions:
488
errors:
@@ -237,10 +321,17 @@ operations:
237321
set_output_custom_method_name: CustomCreateUserGroupSetOutput
238322
DescribeUserGroups:
239323
set_output_custom_method_name: CustomDescribeUserGroupsSetOutput
324+
CreateCacheCluster:
325+
set_output_custom_method_name: customCreateCacheClusterSetOutput
326+
ModifyCacheCluster:
327+
set_output_custom_method_name: customModifyCacheClusterSetOutput
328+
override_values:
329+
ApplyImmediately: true
240330
ignore:
241331
resource_names:
332+
- ServerlessCache
333+
- ServerlessCacheSnapshot
242334
- GlobalReplicationGroup
243-
- CacheCluster
244335
- CacheSecurityGroup
245336
field_paths:
246337
- DescribeSnapshotsInput.CacheClusterId
@@ -255,3 +346,5 @@ ignore:
255346
- CreateReplicationGroupInput.GlobalReplicationGroupId
256347
- CreateReplicationGroupInput.AutoMinorVersionUpgrade
257348
- CreateReplicationGroupInput.NumCacheClusters
349+
- CacheCluster.LogDeliveryConfigurations
350+
- PendingModifiedValues.LogDeliveryConfigurations

0 commit comments

Comments
 (0)