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

archive command fails when the bundle name has a slash #2151

Closed
carolynvs opened this issue Jun 10, 2022 · 2 comments · Fixed by #2154
Closed

archive command fails when the bundle name has a slash #2151

carolynvs opened this issue Jun 10, 2022 · 2 comments · Fixed by #2154
Assignees
Labels
bug Oops, sorry! cnab Related to the CNAB spec
Milestone

Comments

@carolynvs
Copy link
Member

carolynvs commented Jun 10, 2022

Describe the bug

When I try to archive a bundle that has a slash in the bundle name, archive fails.

To Reproduce

$ porter archive whalegap.tgz --reference ghcr.io/getporter/examples/whalegap:v0.2.0
Writing logs to /Users/carolynvs/.porter/logs/01G57B1W09P2FB11DQHJYRPBQV.json
Writing logs to /Users/carolynvs/.porter/logs/01G57B1W09P2FB11DQHJYRPBQV.json
Writing logs to /Users/carolynvs/.porter/logs/01G57B1W09P2FB11DQHJYRPBQV.json
Writing logs to /Users/carolynvs/.porter/logs/01G57B1W09P2FB11DQHJYRPBQV.json
mkdir /var/folders/mv/cx7sy9c54wn741p4x6v0_t100000gn/T/examples/whalegap-0.2.0350843934: no such file or directory

Expected behavior

The command should succeed. Seems like the problem is that we are making a directory with the name of the bundle and it's causing a missing parent directory.

Let's fix this by cleaning up the bundle name before using it as a directory name. There may be other allowed characters in a bundle name by the CNAB spec that could also cause trouble when put in a path. Maybe just do a string replace for anything that isn't a-z0-9-_. and turn it into underscores?

Version

1.0.0-alpha.20

@carolynvs carolynvs added the bug Oops, sorry! label Jun 10, 2022
@carolynvs
Copy link
Member Author

I'm assigning this to the 1.0 release since it's affecting ALL of our example bundles since they use this in the porter.yaml file

name: examples/SOMENAME

@carolynvs carolynvs added this to the 1.0 milestone Jun 10, 2022
@carolynvs carolynvs added the cnab Related to the CNAB spec label Jun 10, 2022
@VinozzZ VinozzZ self-assigned this Jun 15, 2022
@github-actions
Copy link

Closed by #2154.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oops, sorry! cnab Related to the CNAB spec
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants