Skip to content
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

Restore file permissions after unzip #401

Merged
merged 3 commits into from
Nov 10, 2022
Merged

Conversation

Beau-Gosse-dev
Copy link
Contributor

@Beau-Gosse-dev Beau-Gosse-dev commented Nov 10, 2022

Description of changes:

Because of this issue, files coming back from Amazon.Lambda.Tools were not getting the same permissions after unzipping. In the case where we want to sam local invoke on a custom runtime, this means we'll get a permission error since the unzipped files don't have execute permissions. This uses the code from SAM CLI to set permissions correctly.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at. labels Nov 10, 2022
Copy link
Contributor

@jfuss jfuss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks good. Just a small comment to address.

LOG = logging.getLogger(__name__)


def _is_symlink(file_info):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this into the OSUtils instead of global scope?

It would be useful to have a comment and link to the code in SAM CLI. Just helps future people know we copied it from one place to the other.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I assume you want all the new methods inside OSUtils then? Is that right? I'll add the comment and a link to the code in SAM CLI

@mndeveci mndeveci merged commit 83af8e2 into aws:develop Nov 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr/external stage/needs-triage Automatically applied to new issues and PRs, indicating they haven't been looked at.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants