-
Notifications
You must be signed in to change notification settings - Fork 23
fix: Update support for Layers
#136
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
if delta.DifferentAt("Spec.Environment") { | ||
environment := &svcsdk.Environment{} | ||
if dspec.Environment != nil { | ||
environment.Variables = dspec.Environment.DeepCopy().Variables | ||
} | ||
input.Environment = environment | ||
} | ||
|
||
if delta.DifferentAt("Spec.EphemeralStorage") { | ||
ephemeralStorage := &svcsdk.EphemeralStorage{} | ||
if dspec.EphemeralStorage != nil { | ||
ephemeralStorageCopy := dspec.EphemeralStorage.DeepCopy() | ||
ephemeralStorage.Size = ephemeralStorageCopy.Size | ||
} | ||
input.EphemeralStorage = ephemeralStorage | ||
} | ||
|
||
if delta.DifferentAt("Spec.FileSystemConfigs") { | ||
fileSystemConfigs := []*svcsdk.FileSystemConfig{} | ||
if len(dspec.FileSystemConfigs) > 0 { | ||
for _, elem := range dspec.FileSystemConfigs { | ||
elemCopy := elem.DeepCopy() | ||
fscElem := &svcsdk.FileSystemConfig{ | ||
Arn: elemCopy.ARN, | ||
LocalMountPath: elemCopy.LocalMountPath, | ||
} | ||
fileSystemConfigs = append(fileSystemConfigs, fscElem) | ||
} | ||
input.FileSystemConfigs = fileSystemConfigs | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Vandita2020 ! How are environement/ephemeralStorage/FileSystemConfigs/Timeouts affecting to layers?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey, I have just rearranged them according to the order in the API. Please ignore them, no changes for them.
} | ||
ko.Spec.Layers = layer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we have some smoke tests around layers updates?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
f1956ac
to
2a6c3db
Compare
/test lambda-kind-e2e |
10fb31e
to
74df9d2
Compare
74df9d2
to
24d4989
Compare
assert lambda_validator.function_exists(resource_name) | ||
|
||
# Update cr | ||
layers_list = ["arn:aws:lambda:us-west-2:017000801446:layer:AWSLambdaPowertoolsPythonV2:68", "arn:aws:lambda:us-west-2:580247275435:layer:LambdaInsightsExtension:52"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
qq: I guess those are official layers that anybody can reference?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, those are from the list of layers provided by AWS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you @Vandita2020 !
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: a-hilaly, Vandita2020 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
**Description:** This PR corrects a small mistake made in [this PR](#136). **Acknowledgement:** By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Description:
This PR adds the missing update feature for
Layers
property in Function resource.Acknowledgement:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.