cloudfoundry / cli

The official command line client for Cloud Foundry
https://docs.cloudfoundry.org/cf-cli
Apache License 2.0
1.75k stars 927 forks source link

Cannot specify "." current directory as buildpack path #202

Closed drnic closed 9 years ago

drnic commented 10 years ago

Can successfully create-buildpack from the parent folder:

$ cf create-buildpack my my-buildpack 10
Creating buildpack my...
OK

Uploading buildpack my...
OK

But if we run create-buildpack within the buildpack folder it fails:

$ cd my-buildpack/
my-buildpack$ cf create-buildpack my2 . 10
Creating buildpack my2...
OK

Uploading buildpack my2...
FAILED
Server error, status code: 400, error code: 290002, message: The buildpack upload is invalid: only zip files allowed

Perhaps the CLI does not resolve the provided path to an absolute path first?

cf-gitbot commented 10 years ago

We have created an issue in Pivotal Tracker to manage this. You can view the current status of your issue at: https://www.pivotaltracker.com/story/show/74740824.

ghost commented 10 years ago

@drnic Thanks for the report. We'll add this as a confirmed bug to the CLI tracker.

Thanks, @DanLavine and @dliebreich CF Community Pair

lcddave commented 10 years ago

I don't believe you should able to specify directories only files. The fix may be to remove the directory input.

tjarratt commented 10 years ago

Fairly confident that @drnic is correct -- we treat it like a path (either absolute or relative). The fix to support this would be to use filepath.Abs(userSuppliedPath). Seems pretty straightforward.

Might be worth investigating how many other places in the cli we allow users to supply paths that won't work if a user supplies a path like this.

goehmen commented 9 years ago

Issue resolved & story accepted.

±  |master ✓| → cf create-buildpack greg-buildpack1 . 8 --disable
Creating buildpack greg-buildpack1...
OK

Uploading buildpack greg-buildpack1...
Done uploading
OK

On edge now. Will be in 6.8.0