Skip to content

Commit 044877e

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 044877e

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

+7365
-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-28T14:33:25Z"
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: 73afd1cf92f1261c45bbb52544adf4da5c6a7cd0
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: 3c359b3f45716af86c99ab2ea0f2ab50eeae5dc9
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

+95-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,89 @@
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+
is_immutable: true
13+
ReplicationGroupID:
14+
references:
15+
resource: ReplicationGroup
16+
path: Spec.ReplicationGroupID
17+
is_immutable: true
18+
SnapshotName:
19+
references:
20+
resource: Snapshot
21+
path: Spec.SnapshotName
22+
is_immutable: true
23+
NotificationTopicARN:
24+
references:
25+
service_name: sns
26+
resource: Topic
27+
path: Status.ACKResourceMetadata.ARN
28+
AuthToken:
29+
is_secret: true
30+
PreferredAvailabilityZone:
31+
late_initialize: {}
32+
PreferredAvailabilityZones:
33+
compare:
34+
is_ignored: true
35+
print:
36+
add_age_column: true
37+
add_synced_column: true
38+
order_by: index
39+
additional_columns:
40+
- name: VERSION
41+
json_path: .spec.engineVersion
42+
type: string
43+
index: 10
44+
- name: STATUS
45+
json_path: .status.cacheClusterStatus
46+
type: string
47+
index: 20
48+
- name: ENDPOINT
49+
json_path: .status.configurationEndpoint.address
50+
type: string
51+
index: 30
52+
priority: 1
53+
exceptions:
54+
errors:
55+
404:
56+
code: CacheClusterNotFound
57+
terminal_codes:
58+
- ReplicationGroupNotFoundFault
59+
- InvalidReplicationGroupStateFault
60+
- CacheClusterAlreadyExistsFault
61+
- InsufficientCacheClusterCapacityFault
62+
- CacheSecurityGroupNotFoundFault
63+
- CacheSubnetGroupNotFoundFault
64+
- ClusterQuotaForCustomerExceededFault
65+
- NodeQuotaForClusterExceededFault
66+
- NodeQuotaForCustomerExceededFault
67+
- CacheParameterGroupNotFoundFault
68+
- InvalidVPCNetworkStateFault
69+
- TagQuotaPerResource
70+
- InvalidParameterValue
71+
- InvalidParameterCombination
72+
hooks:
73+
sdk_create_post_set_output:
74+
template_path: hooks/cache_cluster/sdk_create_post_set_output.go.tpl
75+
sdk_delete_pre_build_request:
76+
template_path: hooks/cache_cluster/sdk_delete_pre_build_request.go.tpl
77+
sdk_read_many_post_set_output:
78+
template_path: hooks/cache_cluster/sdk_read_many_post_set_output.go.tpl
79+
sdk_update_pre_build_request:
80+
template_path: hooks/cache_cluster/sdk_update_pre_build_request.go.tpl
81+
sdk_update_post_build_request:
82+
template_path: hooks/cache_cluster/sdk_update_post_build_request.go.tpl
83+
sdk_update_post_set_output:
84+
template_path: hooks/cache_cluster/sdk_update_post_set_output.go.tpl
85+
delta_post_compare:
86+
code: "modifyDelta(delta, a, b)"
287
CacheSubnetGroup:
388
exceptions:
489
errors:
@@ -237,10 +322,17 @@ operations:
237322
set_output_custom_method_name: CustomCreateUserGroupSetOutput
238323
DescribeUserGroups:
239324
set_output_custom_method_name: CustomDescribeUserGroupsSetOutput
325+
CreateCacheCluster:
326+
set_output_custom_method_name: customCreateCacheClusterSetOutput
327+
ModifyCacheCluster:
328+
set_output_custom_method_name: customModifyCacheClusterSetOutput
329+
override_values:
330+
ApplyImmediately: true
240331
ignore:
241332
resource_names:
333+
- ServerlessCache
334+
- ServerlessCacheSnapshot
242335
- GlobalReplicationGroup
243-
- CacheCluster
244336
- CacheSecurityGroup
245337
field_paths:
246338
- DescribeSnapshotsInput.CacheClusterId
@@ -255,3 +347,5 @@ ignore:
255347
- CreateReplicationGroupInput.GlobalReplicationGroupId
256348
- CreateReplicationGroupInput.AutoMinorVersionUpgrade
257349
- CreateReplicationGroupInput.NumCacheClusters
350+
- CacheCluster.LogDeliveryConfigurations
351+
- PendingModifiedValues.LogDeliveryConfigurations

0 commit comments

Comments
 (0)