Skip to content

Commit 4a72b7b

Browse files
authored
Adding support for Function version (#113)
**Summary**: Adding support to publish `Version` for a `Function`. **Description**: This PR adds implementation of AWS Lambda’s `Function Version` feature in the ACK. Function versions allow developers to publish new versions of their Lambda functions while maintaining older versions for backward compatibility or testing purposes. This will allow developers to publish new versions of their lambda functions and manage function updates seamlessly using ACK. `Version` resource for a Function can be created using following manifest: ``` apiVersion: lambda.services.k8s.aws/v1alpha1 kind: Version metadata: name: $VERSION_NAME annotations: services.k8s.aws/region: $AWS_REGION spec: functionName: $FUNCTION_NAME codeSHA256: $HASH revisionID: $REVISION_ID description: version created by ACK lambda-controller e2e tests ``` The PR supports creation and deletion of `Version` resource. It also includes E2E tests to verify the functionality. **Acknowledgment**: By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 42e502c commit 4a72b7b

30 files changed

+3419
-9
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-12-22T06:14:56Z"
3-
build_hash: 1f16813c807af6889060b4ce7ded2a69dc027d8c
4-
go_version: go1.21.5
5-
version: v0.28.0
6-
api_directory_checksum: 1c73101b17769d9e1165fbb915bdeeb3dcd8b075
2+
build_date: "2024-01-10T21:05:33Z"
3+
build_hash: 1563ceb2b15ff29ee692b4178d4de5f2cbe0b0f0
4+
go_version: go1.19
5+
version: v0.28.0-12-g1563ceb
6+
api_directory_checksum: 6d988b03425fad3e88d887c1cd4510a07e4be281
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.181
99
generator_config_info:
10-
file_checksum: 8b0c7bd625c74c9a471db45bbf8697069d35b218
10+
file_checksum: 5101c7f40235cfe24d7916bc0cbc95498e1d5e6c
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,24 @@ operations:
1111
operation_type:
1212
- Create
1313
- Update
14-
resource_name: LayerVersion
14+
resource_name:
15+
- LayerVersion
16+
PublishVersion:
17+
operation_type:
18+
- Create
19+
resource_name:
20+
- Version
21+
GetFunctionConfiguration:
22+
operation_type:
23+
- ReadOne
24+
resource_name:
25+
- Version
26+
DeleteFunction:
27+
operation_type:
28+
- Delete
29+
resource_name:
30+
- Version
31+
- Function
1532
resources:
1633
Function:
1734
synced:
@@ -196,3 +213,30 @@ resources:
196213
ListLayerVersions:
197214
input_fields:
198215
Version: VersionNumber
216+
Version:
217+
fields:
218+
FunctionName:
219+
is_required: true
220+
is_primary_key: true
221+
Qualifier:
222+
is_read_only: true
223+
from:
224+
operation: GetFunctionConfiguration
225+
path: Version
226+
tags:
227+
ignore: true
228+
hooks:
229+
sdk_read_one_pre_build_request:
230+
template_path: hooks/version/sdk_read_one_pre_build_request.go.tpl
231+
sdk_create_pre_build_request:
232+
template_path: hooks/version/sdk_create_pre_build_request.go.tpl
233+
sdk_create_pre_set_output:
234+
template_path: hooks/version/sdk_create_pre_set_output.go.tpl
235+
renames:
236+
operations:
237+
DeleteFunction:
238+
input_fields:
239+
Qualifier: Version
240+
GetFunctionConfiguration:
241+
input_fields:
242+
Qualifier: Version

apis/v1alpha1/version.go

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

0 commit comments

Comments
 (0)