Skip to content

Commit cfbb479

Browse files
authored
Add Function update code path (#11)
Issue aws-controllers-k8s/community#1062 Adds support for updating `Function` resources Description of changes: - Add custom code to properly make update calls for functions - Add custom delta pre compare code to ignore `spec.code.s3Bucket` changes - Add an `sdk_read_one_post_set_output` hook to add missing fields at the set_output part. By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 572c1bf commit cfbb479

File tree

9 files changed

+979
-43
lines changed

9 files changed

+979
-43
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
ack_generate_info:
2-
build_date: "2021-11-16T16:25:06Z"
3-
build_hash: f8366f06104baf96f8fe2d1b086ea0ac632318de
2+
build_date: "2021-11-19T13:19:34Z"
3+
build_hash: dca757058c55b80b4eb20f62f55829981a70f7de
44
go_version: go1.16.4
55
version: v0.15.2
66
api_directory_checksum: 84d93710fb0b89a7ed99b0923611297242a55a99
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.40.28
99
generator_config_info:
10-
file_checksum: 1bc55e6356761b977771bdc242b2ddc5bc0e5657
10+
file_checksum: 4f4df395ccad50e23ed16cffcf1d4d24a909f9cc
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ resources:
1212
Name:
1313
is_primary_key: true
1414
is_required: true
15+
# ReservedConcurrentExecutions:
16+
# from:
17+
# operation: PutFunctionConcurrency
18+
# path: ReservedConcurrentExecutions
19+
Code:
20+
compare:
21+
is_ignored: true
1522
renames:
1623
operations:
1724
CreateFunction:
@@ -23,6 +30,13 @@ resources:
2330
GetFunction:
2431
input_fields:
2532
FunctionName: Name
33+
hooks:
34+
delta_pre_compare:
35+
code: customPreCompare(delta, a, b)
36+
sdk_read_one_post_set_output:
37+
template_path: hooks/function/sdk_read_one_post_set_output.go.tpl
38+
update_operation:
39+
custom_method_name: customUpdateFunction
2640
Alias:
2741
fields:
2842
Name:

generator.yaml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ resources:
1212
Name:
1313
is_primary_key: true
1414
is_required: true
15+
# ReservedConcurrentExecutions:
16+
# from:
17+
# operation: PutFunctionConcurrency
18+
# path: ReservedConcurrentExecutions
19+
Code:
20+
compare:
21+
is_ignored: true
1522
renames:
1623
operations:
1724
CreateFunction:
@@ -23,6 +30,13 @@ resources:
2330
GetFunction:
2431
input_fields:
2532
FunctionName: Name
33+
hooks:
34+
delta_pre_compare:
35+
code: customPreCompare(delta, a, b)
36+
sdk_read_one_post_set_output:
37+
template_path: hooks/function/sdk_read_one_post_set_output.go.tpl
38+
update_operation:
39+
custom_method_name: customUpdateFunction
2640
Alias:
2741
fields:
2842
Name:

pkg/resource/function/delta.go

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

0 commit comments

Comments
 (0)