Skip to content

Commit 67b7543

Browse files
committed
feat: add refs support for various fields
The following fields have had refs support added: - CacheSubnetGroup.SubnetIDs: ec2.Subnet.Status.SubnetID - ReplicationGroup.CacheParameterGroupName: CacheParameterGroup.Spec.CacheParameterGroupName - ReplicationGroup.CacheSubnetGroupName: CacheSubnetGroup.Spec.CacheSubnetGroupName - ReplicationGroup.SecurityGroupIDs: ec2.SecurityGroup.Status.ID Closes aws-controllers-k8s/community#1513 Closes aws-controllers-k8s/community#1860
1 parent 41717fa commit 67b7543

20 files changed

+683
-18
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: "2023-09-18T21:10:37Z"
3-
build_hash: 892f29d00a4c4ad21a2fa32919921de18190979d
4-
go_version: go1.20.3
5-
version: v0.27.1
6-
api_directory_checksum: 885f952f7ca2ce7a676b9bbf8eb262de71de6238
2+
build_date: "2023-11-22T07:12:46Z"
3+
build_hash: 1cc9b5172d3d1676af578a3411e8672698ec29ce
4+
go_version: go1.21.4
5+
version: v0.27.1-5-g1cc9b51-dirty
6+
api_directory_checksum: bd34f72147706f1dbc990acf4a6c4f6615c1bddb
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.93
99
generator_config_info:
10-
file_checksum: bd93202f4d05393bb2ff98344e8e603e3228cc51
10+
file_checksum: 3f88502d4b7623890c8eff789285f98fa3d84553
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/cache_subnet_group.go

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

apis/v1alpha1/generator.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ resources:
1313
- InvalidParameterValue
1414
- InvalidParameterCombination
1515
fields:
16+
SubnetIDs:
17+
references:
18+
service_name: ec2
19+
resource: Subnet
20+
path: Status.SubnetID
1621
Events:
1722
is_read_only: true
1823
from:
@@ -50,6 +55,19 @@ resources:
5055
AutomaticFailoverEnabled:
5156
compare:
5257
is_ignored: true
58+
CacheParameterGroupName:
59+
references:
60+
resource: CacheParameterGroup
61+
path: Spec.CacheParameterGroupName
62+
CacheSubnetGroupName:
63+
references:
64+
resource: CacheSubnetGroup
65+
path: Spec.CacheSubnetGroupName
66+
SecurityGroupIDs:
67+
references:
68+
resource: SecurityGroup
69+
service_name: ec2
70+
path: Status.ID
5371
Events:
5472
is_read_only: true
5573
from:

apis/v1alpha1/replication_group.go

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

apis/v1alpha1/zz_generated.deepcopy.go

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

cmd/controller/main.go

Lines changed: 2 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_cachesubnetgroups.yaml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,22 @@ spec:
5050
items:
5151
type: string
5252
type: array
53+
subnetRefs:
54+
items:
55+
description: "AWSResourceReferenceWrapper provides a wrapper around
56+
*AWSResourceReference type to provide more user friendly syntax
57+
for references using 'from' field Ex: APIIDRef: \n from: name:
58+
my-api"
59+
properties:
60+
from:
61+
description: AWSResourceReference provides all the values necessary
62+
to reference another k8s resource for finding the identifier(Id/ARN/Name)
63+
properties:
64+
name:
65+
type: string
66+
type: object
67+
type: object
68+
type: array
5369
tags:
5470
description: A list of tags to be added to this resource. A tag is
5571
a key-value pair. A tag key must be accompanied by a tag value,
@@ -72,7 +88,6 @@ spec:
7288
required:
7389
- cacheSubnetGroupDescription
7490
- cacheSubnetGroupName
75-
- subnetIDs
7691
type: object
7792
status:
7893
description: CacheSubnetGroupStatus defines the observed state of CacheSubnetGroup

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

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,19 @@ spec:
140140
\n * To create a Redis (cluster mode enabled) replication group,
141141
use CacheParameterGroupName=default.redis3.2.cluster.on."
142142
type: string
143+
cacheParameterGroupRef:
144+
description: "AWSResourceReferenceWrapper provides a wrapper around
145+
*AWSResourceReference type to provide more user friendly syntax
146+
for references using 'from' field Ex: APIIDRef: \n from: name: my-api"
147+
properties:
148+
from:
149+
description: AWSResourceReference provides all the values necessary
150+
to reference another k8s resource for finding the identifier(Id/ARN/Name)
151+
properties:
152+
name:
153+
type: string
154+
type: object
155+
type: object
143156
cacheSecurityGroupNames:
144157
description: A list of cache security group names to associate with
145158
this replication group.
@@ -153,6 +166,19 @@ spec:
153166
creating a cluster. For more information, see Subnets and Subnet
154167
Groups (https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SubnetGroups.html)."
155168
type: string
169+
cacheSubnetGroupRef:
170+
description: "AWSResourceReferenceWrapper provides a wrapper around
171+
*AWSResourceReference type to provide more user friendly syntax
172+
for references using 'from' field Ex: APIIDRef: \n from: name: my-api"
173+
properties:
174+
from:
175+
description: AWSResourceReference provides all the values necessary
176+
to reference another k8s resource for finding the identifier(Id/ARN/Name)
177+
properties:
178+
name:
179+
type: string
180+
type: object
181+
type: object
156182
dataTieringEnabled:
157183
description: Enables data tiering. Data tiering is only supported
158184
for replication groups using the r6gd node type. This parameter
@@ -326,6 +352,22 @@ spec:
326352
items:
327353
type: string
328354
type: array
355+
securityGroupRefs:
356+
items:
357+
description: "AWSResourceReferenceWrapper provides a wrapper around
358+
*AWSResourceReference type to provide more user friendly syntax
359+
for references using 'from' field Ex: APIIDRef: \n from: name:
360+
my-api"
361+
properties:
362+
from:
363+
description: AWSResourceReference provides all the values necessary
364+
to reference another k8s resource for finding the identifier(Id/ARN/Name)
365+
properties:
366+
name:
367+
type: string
368+
type: object
369+
type: object
370+
type: array
329371
snapshotARNs:
330372
description: "A list of Amazon Resource Names (ARN) that uniquely
331373
identify the Redis RDB snapshot files stored in Amazon S3. The snapshot

config/rbac/cluster-role-controller.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,34 @@ rules:
3131
- list
3232
- patch
3333
- watch
34+
- apiGroups:
35+
- ec2.services.k8s.aws
36+
resources:
37+
- securitygroups
38+
verbs:
39+
- get
40+
- list
41+
- apiGroups:
42+
- ec2.services.k8s.aws
43+
resources:
44+
- securitygroups/status
45+
verbs:
46+
- get
47+
- list
48+
- apiGroups:
49+
- ec2.services.k8s.aws
50+
resources:
51+
- subnets
52+
verbs:
53+
- get
54+
- list
55+
- apiGroups:
56+
- ec2.services.k8s.aws
57+
resources:
58+
- subnets/status
59+
verbs:
60+
- get
61+
- list
3462
- apiGroups:
3563
- elasticache.services.k8s.aws
3664
resources:

generator.yaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ resources:
1313
- InvalidParameterValue
1414
- InvalidParameterCombination
1515
fields:
16+
SubnetIDs:
17+
references:
18+
service_name: ec2
19+
resource: Subnet
20+
path: Status.SubnetID
1621
Events:
1722
is_read_only: true
1823
from:
@@ -50,6 +55,19 @@ resources:
5055
AutomaticFailoverEnabled:
5156
compare:
5257
is_ignored: true
58+
CacheParameterGroupName:
59+
references:
60+
resource: CacheParameterGroup
61+
path: Spec.CacheParameterGroupName
62+
CacheSubnetGroupName:
63+
references:
64+
resource: CacheSubnetGroup
65+
path: Spec.CacheSubnetGroupName
66+
SecurityGroupIDs:
67+
references:
68+
resource: SecurityGroup
69+
service_name: ec2
70+
path: Status.ID
5371
Events:
5472
is_read_only: true
5573
from:

0 commit comments

Comments
 (0)