Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

remove shell-escaping url in S3ZipContent #200

Merged
merged 3 commits into from
Mar 6, 2020
Merged

remove shell-escaping url in S3ZipContent #200

merged 3 commits into from
Mar 6, 2020

Conversation

lorenzo-ange
Copy link
Contributor

Hello,
when I deploy a Kubeless function with strategy: S3ZipContent, the deploy fails.

The pod goes in Init:CrashLoopBackOff status because the Kubeless prepare initContainer cannot retrieve the artifact from the bucket using the S3 presigned url.

Logs of the prepare initContainer:

sh: 1: -L: not found

The issue seems related to the CURL command in the preapre container that has the url argument with two quotes before and after the url.

Example:

curl ''https://grid.photosi.com/kubeless-artifacts-test/microservice-sls-test-1583329211862.zip?AWSAccessKeyId=XXXXX&Expires=1614865212&Signature=a%2Fc%2F5A3k3G0EbL%2Fz0Up9u8m6pN0%3D''
          -L --silent --output /tmp/func.fromurl && echo 'f68e1c7f7427afdc65b4cdcd514239fdb3ffd4850cb00cd6032189305b9ee827  /tmp/func.fromurl'
          > /tmp/func.sha256 && sha256sum -c /tmp/func.sha256 && unzip -o /tmp/func.fromurl
          -d /kubeless && cp /src/project.csproj /kubeless

Seems that shellescape in lib/strategy/s3_zip_content.js is the cause of this issue and I think it should be no more necessary because of this commit to the kubeless project.

I hope this PR could be merged to fix issues with S3ZipContent deploys.
Let me know if you have any questions, comments or suggestions.

Thank you very much for your work,
Lorenzo Angelini

@andresmgot
Copy link
Contributor

Thanks for the PR @lorenzo-ange!

From your comment is not clear to me if you were able to verify if removing that dependency fixes the problem. Can you confirm it?

Also, to automatically publish your changes, do you mind increasing the version of the package in the package.json?

@lorenzo-ange
Copy link
Contributor Author

lorenzo-ange commented Mar 5, 2020

Hi @andresmgot ,
I confirm that this PR fixes the problem.
I updated the package version in package.json and also updated the Kubeless and Kubeless Kafka versions in travis-ci configuration to make the tests pass.

Thank you,
Lorenzo

Copy link
Contributor

@andresmgot andresmgot left a comment

Choose a reason for hiding this comment

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

Great! Thanks for the update

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants