cli icon indicating copy to clipboard operation
cli copied to clipboard

Cannot specify "." current directory as buildpack path

Open drnic opened this issue 12 years ago • 5 comments

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?

drnic avatar Jul 09 '14 23:07 drnic

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.

cf-gitbot avatar Jul 09 '14 23:07 cf-gitbot

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

Thanks, @DanLavine and @dliebreich CF Community Pair

ghost avatar Jul 09 '14 23:07 ghost

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

lcddave avatar Jul 10 '14 19:07 lcddave

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.

tjarratt avatar Jul 10 '14 22:07 tjarratt

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

goehmen avatar Dec 10 '14 18:12 goehmen