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

upload-stemcell requires absolute filepath when filename contains brackets #498

Closed
drawsmcgraw opened this issue Jun 5, 2020 · 8 comments

Comments

@drawsmcgraw
Copy link

When om download-product downloads a stemcell, the stemcell filename is prefixed with brackets for metadata (i.e. [product-slug,product-version]product-filename.tgz).

When om upload-stemcell is used on files with names like this, the upload fails with a message similar to the following:

could not execute "upload-stemcell": failed to upload stemcell: open tmp-download/light-bosh-stemcell-456.100-aws-xen-hvm-ubuntu-xenial-go_agent.tgz: no such file or directory

In the above example, the command run was:

om -k upload-stemcell --floating=true --stemcell "$DOWNLOAD_DIR"/*.tgz

And DOWNLOAD_DIR has the value tmp-download.

My expectation was that relative paths would be fine but it looks like it requires absolute paths.

Understanding that a fix to the behavior may be nontrivial, maybe the docs/help output could be amended to say as much regarding absolute/relative paths?

@cf-gitbot
Copy link
Member

We have created an issue in Pivotal Tracker to manage this. Unfortunately, the Pivotal Tracker project is private so you may be unable to view the contents of the story.

The labels on this github issue will be updated when the story is started.

@kcboyle
Copy link
Contributor

kcboyle commented Jun 15, 2020

Hi @drawsmcgraw! Our team has other things that we are focusing on at the moment, and would prefer to just document that you have to use an absolute path.

If you would like to submit a PR so upload-stemcell can support relative paths, we are more than happy to review and accept it though. Let us know your thoughts.

@drawsmcgraw
Copy link
Author

Thanks @kcboyle! Completely understand the priorities and I agree that the most reasonable path is to document the need. I'm not sure where the best place for that is (help output? official docs?) but I'd be happy to file a docs PR if you point me in the right direction.

@kcboyle
Copy link
Contributor

kcboyle commented Jun 15, 2020

Hi!
We will be able to get around to the documentation (if you have other things your working on) but I see a good place for this just straight in the help for the command)

om upload-stemcell -h

This command will upload a stemcell to the target Ops Manager. Unless the force flag is used, if the stemcell already exists that upload will be skipped

Usage:
  om [options] upload-stemcell [<args>]

Flags:
  --config, -c    string             path to yml file for configuration (keys must match the following command line flags)
  --floating      string             assigns the stemcell to all compatible products  (default: true)
  --force, -f     bool               upload stemcell even if it already exists on the target Ops Manager
  --shasum        string             shasum of the provided product file to be used for validation
  --stemcell, -s  string (required)  path to stemcell

we could update --stemcell to have a description of "the absolute filepath to the stemcell" maybe. Where would you have found it the most helpful when debugging?

@drawsmcgraw
Copy link
Author

I would have certainly found it in the help output. I would suggest making it a little more on-the-nose, though, because I'm extremely hard-headed. Something along the lines of :

--stemcell, -s  string (required)  path to stemcell (NOTE: use absolute path)

@kcboyle
Copy link
Contributor

kcboyle commented Jun 16, 2020

Sounds good to me! Happy to accept a PR if you are so inclined, or we will get to this eventually :)

@kcboyle
Copy link
Contributor

kcboyle commented Jun 16, 2020

actually, this literally took less time to do than we talked about it. Should be fixed now (on main)

@kcboyle
Copy link
Contributor

kcboyle commented Oct 15, 2020

@drawsmcgraw we were taking a look at this again, and are adding support for relative paths.

It should come out in the next release of om

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

No branches or pull requests

3 participants