Skip to content

Commit 0c89ad5

Browse files
authored
Generate AccessPoint CRD (#6)
aws-controllers-k8s/community#328 Generate `AccessPoint` resource - Add necessary hooks for create/update/delete methods - Add e2e tests for CRUD operations By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 2ed5e52 commit 0c89ad5

35 files changed

+3086
-9
lines changed

apis/v1alpha1/access_point.go

Lines changed: 107 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2024-02-10T22:33:46Z"
3-
build_hash: 6af91cdf64ccaf8cab2a43397266e57d1ec553de
2+
build_date: "2024-02-11T03:01:49Z"
3+
build_hash: 3b621aa5580a69c58beee58a9ed63346716f347f
44
go_version: go1.21.5
5-
version: v0.29.2-5-g6af91cd
6-
api_directory_checksum: 10383eb3d875d521f49d3d04af20466640088918
5+
version: v0.29.2-6-g3b621aa
6+
api_directory_checksum: 3dac0a046021e0a9f5828ed93eb269ab4d4420a0
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.50.0
99
generator_config_info:
10-
file_checksum: af9d4b44e466c5b36fe8b5ba2917949c29eab806
10+
file_checksum: 0e7aae484d5cb71e81def3f3f385ba306424fbf1
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 71 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
ignore:
22
resource_names:
3-
- AccessPoint
3+
# AccessPoint
44
# FileSystem
55
# MountTarget
66
- ReplicationConfiguration
@@ -11,6 +11,13 @@ ignore:
1111
- PutLifecycleConfigurationInput.FileSystemId
1212
- PutFileSystemPolicyInput.FileSystemId
1313
- UpdateFileSystemProtectionInput.FileSystemId
14+
# Well, FileSystem idempotency token is called CreationToken
15+
# and AccessPoint idempotency token is called ClientToken.....
16+
- CreateAccessPointInput.ClientToken
17+
- AccessPointDescription.ClientToken
18+
shape_names:
19+
- SecondaryGids
20+
- ClientToken
1421
model_name: elasticfilesystem
1522
controller_name: efs
1623
resources:
@@ -45,6 +52,8 @@ resources:
4552
code: return desired, nil
4653
sdk_create_post_set_output:
4754
template_path: hooks/file_system/sdk_create_post_set_output.go.tpl
55+
sdk_create_post_build_request:
56+
template_path: hooks/file_system/sdk_create_post_build_request.go.tpl
4857
sdk_read_many_post_set_output:
4958
template_path: hooks/file_system/sdk_read_many_post_set_output.go.tpl
5059
sdk_update_pre_build_request:
@@ -152,6 +161,67 @@ resources:
152161
type: string
153162
index: 37
154163
priority: 1
164+
- name: STATE
165+
json_path: .status.lifeCycleState
166+
type: string
167+
index: 40
168+
AccessPoint:
169+
fields:
170+
PosixUser:
171+
is_immutable: true
172+
RootDirectory:
173+
is_immutable: true
174+
PosixUser.SecondaryGids:
175+
type: "[]*int64"
176+
compare:
177+
is_ignored: true
178+
# This is a workaround for the fact that code-generator
179+
# isn't smart enough to understand this.
180+
# TODO(a-hilaly): Remove this once the issue is fixed
181+
PosixUser.SecondaryGIDs:
182+
compare:
183+
is_ignored: true
184+
FileSystemId:
185+
references:
186+
resource: FileSystem
187+
path: Status.FileSystemID
188+
is_immutable: true
189+
update_operation:
190+
custom_method_name: customUpdateAccessPoint
191+
hooks:
192+
delta_pre_compare:
193+
code: customPreCompare(delta, a, b)
194+
sdk_create_post_build_request:
195+
template_path: hooks/access_point/sdk_create_post_build_request.go.tpl
196+
sdk_read_many_post_build_request:
197+
template_path: hooks/access_point/sdk_read_many_post_build_request.go.tpl
198+
sdk_read_many_post_set_output:
199+
template_path: hooks/access_point/sdk_read_many_post_set_output.go.tpl
200+
print:
201+
add_age_column: true
202+
add_synced_column: true
203+
order_by: index
204+
additional_columns:
205+
- name: ID
206+
json_path: .status.accessPointID
207+
type: string
208+
index: 5
209+
- name: FILESYSTEMID
210+
json_path: .spec.fileSystemID
211+
type: string
212+
index: 10
213+
- name: ROOTDIRECTORY
214+
json_path: .spec.rootDirectory.path
215+
type: string
216+
index: 20
217+
- name: POSIXUSERUID
218+
json_path: .spec.posixUser.uid
219+
type: integer
220+
index: 25
221+
- name: POSIXUSERGID
222+
json_path: .spec.posixUser.gid
223+
type: integer
224+
index: 30
155225
- name: STATE
156226
json_path: .status.lifeCycleState
157227
type: string

apis/v1alpha1/types.go

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

0 commit comments

Comments
 (0)