Skip to content

Commit 488981c

Browse files
authored
Support passing Function reference in Version resource (#114)
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
1 parent 862aee4 commit 488981c

File tree

11 files changed

+210
-11
lines changed

11 files changed

+210
-11
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: "2024-01-10T21:05:33Z"
2+
build_date: "2024-01-11T18:38:51Z"
33
build_hash: 1563ceb2b15ff29ee692b4178d4de5f2cbe0b0f0
44
go_version: go1.19
55
version: v0.28.0-12-g1563ceb
6-
api_directory_checksum: 6d988b03425fad3e88d887c1cd4510a07e4be281
6+
api_directory_checksum: 72bea0d84787d3f6fcaf7bbbc7f576a6d78b4609
77
api_version: v1alpha1
88
aws_sdk_go_version: v1.44.181
99
generator_config_info:
10-
file_checksum: 5101c7f40235cfe24d7916bc0cbc95498e1d5e6c
10+
file_checksum: 0f86b7a7f2adfe243a9aa055853514f6b4c16645
1111
original_file_name: generator.yaml
1212
last_modification:
1313
reason: API generation

apis/v1alpha1/generator.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ resources:
218218
FunctionName:
219219
is_required: true
220220
is_primary_key: true
221+
references:
222+
resource: Function
223+
path: Spec.Name
221224
Qualifier:
222225
is_read_only: true
223226
from:

apis/v1alpha1/version.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/zz_generated.deepcopy.go

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

config/crd/bases/lambda.services.k8s.aws_versions.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,25 @@ spec:
5252
constraint applies only to the full ARN. If you specify only the
5353
function name, it is limited to 64 characters in length."
5454
type: string
55+
functionRef:
56+
description: "AWSResourceReferenceWrapper provides a wrapper around
57+
*AWSResourceReference type to provide more user friendly syntax
58+
for references using 'from' field Ex: APIIDRef: \n from: name: 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
5568
revisionID:
5669
description: Only update the function if the revision ID matches the
5770
ID that's specified. Use this option to avoid publishing a version
5871
if the function configuration has changed since you last updated
5972
it.
6073
type: string
61-
required:
62-
- functionName
6374
type: object
6475
status:
6576
description: VersionStatus defines the observed state of Version

generator.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,9 @@ resources:
218218
FunctionName:
219219
is_required: true
220220
is_primary_key: true
221+
references:
222+
resource: Function
223+
path: Spec.Name
221224
Qualifier:
222225
is_read_only: true
223226
from:

helm/crds/lambda.services.k8s.aws_versions.yaml

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,25 @@ spec:
5252
constraint applies only to the full ARN. If you specify only the
5353
function name, it is limited to 64 characters in length."
5454
type: string
55+
functionRef:
56+
description: "AWSResourceReferenceWrapper provides a wrapper around
57+
*AWSResourceReference type to provide more user friendly syntax
58+
for references using 'from' field Ex: APIIDRef: \n from: name: 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
5568
revisionID:
5669
description: Only update the function if the revision ID matches the
5770
ID that's specified. Use this option to avoid publishing a version
5871
if the function configuration has changed since you last updated
5972
it.
6073
type: string
61-
required:
62-
- functionName
6374
type: object
6475
status:
6576
description: VersionStatus defines the observed state of Version

pkg/resource/version/delta.go

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

pkg/resource/version/references.go

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

test/e2e/resources/version_ref.yaml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: lambda.services.k8s.aws/v1alpha1
2+
kind: Version
3+
metadata:
4+
name: $VERSION_NAME
5+
annotations:
6+
services.k8s.aws/region: $AWS_REGION
7+
spec:
8+
functionRef:
9+
from:
10+
name: $FUNCTION_REF_NAME
11+
description: version created by ACK lambda-controller e2e tests

0 commit comments

Comments
 (0)