Skip to content

Commit 039f28f

Browse files
authored
feat: Support ClusterV2 as ServerlessCluster (#66)
Issue [#2492](aws-controllers-k8s/community#2492) Description of changes: * Add ClusterV2 support * test crud and tags Extra changes to Cluster resource: * remove unnecessary fmt.Sprintf * ensure SetSynced is applied to the resource that is returned (previously was discarded) * remove commented Tag tests! By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 0d6aa6e commit 039f28f

38 files changed

+4917
-72
lines changed

apis/v1alpha1/ack-generate-metadata.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ api_directory_checksum: 36fbfad1e0bff98a14b120ba292a7f6b4e546fb4
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.32.6
99
generator_config_info:
10-
file_checksum: 76a24bb9624894530a21ecedf80641625d3040c9
10+
file_checksum: a90f1407dba96f7e8716b2fb2fdc3da3ca82ee72
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 62 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
ignore:
22
resource_names:
33
#- Cluster
4-
- ClusterV2
4+
# - ClusterV2
55
- VpcConnection
66
- Replicator
77
#- Configuration
88
field_paths:
99
- ConnectivityInfo.VpcConnectivity
1010
- DescribeClusterOutput.ClusterInfo.BrokerNodeGroupInfo.ZoneIds
11-
11+
operations:
12+
CreateClusterV2:
13+
operation_type:
14+
- Create
15+
resource_name: ServerlessCluster
16+
DescribeClusterV2:
17+
operation_type:
18+
- Get
19+
resource_name: ServerlessCluster
1220
resources:
1321
Configuration:
1422
fields:
@@ -108,4 +116,55 @@ resources:
108116
is_read_only: true
109117
tags:
110118
# TODO(jaypipes): Ignore tags for now... we will add support later
111-
ignore: true
119+
ignore: true
120+
ServerlessCluster:
121+
is_arn_primary_key: true
122+
renames:
123+
operations:
124+
CreateClusterV2:
125+
input_fields:
126+
ClusterName: Name
127+
output_fields:
128+
ClusteName: Name
129+
ClusterType: Type
130+
DescribeClusterV2:
131+
input_fields:
132+
output_fields:
133+
ClusterName: Name
134+
ClusterType: Type
135+
fields:
136+
AssociatedScramSecrets:
137+
type: "[]*string"
138+
references:
139+
resource: Secret
140+
service_name: secretsmanager
141+
path: Status.ACKResourceMetadata.ARN
142+
ClusterARN:
143+
is_arn: true
144+
CurrentVersion:
145+
from:
146+
operation: DescribeCluster
147+
path: ClusterInfo.CurrentVersion
148+
is_read_only: true
149+
Type:
150+
go_tag: json:"type,omitempty"
151+
hooks:
152+
sdk_read_one_post_set_output:
153+
template_path: hooks/serverless_cluster/sdk_read_one_post_set_output.go.tpl
154+
sdk_create_post_set_output:
155+
template_path: hooks/serverless_cluster/sdk_create_post_set_output.go.tpl
156+
sdk_update_pre_build_request:
157+
template_path: hooks/serverless_cluster/sdk_update_pre_build_request.go.tpl
158+
sdk_delete_pre_build_request:
159+
template_path: hooks/serverless_cluster/sdk_delete_pre_build_request.go.tpl
160+
delta_pre_compare:
161+
code: customPreCompare(delta, a, b)
162+
update_operation:
163+
custom_method_name: customUpdate
164+
delete_operation:
165+
custom_method_name: customDelete
166+
synced:
167+
when:
168+
- path: Status.State
169+
in:
170+
- ACTIVE

apis/v1alpha1/serverless_cluster.go

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

apis/v1alpha1/types.go

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

0 commit comments

Comments
 (0)