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

store/boltdb: Allow paths with no slash at the beginning #161

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vishen
Copy link

@vishen vishen commented May 5, 2017

The following was not working for me because of the way libkv handles the path for BoltDB

kv, err := libkv.NewStore(
	store.BOLTDB,
	[]string{"__boltdbtest"},
	&store.Config{
		Bucket: "boltDBTest",
	},
)

I would get the following error because when libkv attempts to create the BoltDB path: mkdir : no such file or directory - It uses https://godoc.org/path/filepath#Split which can return an empty string for dir.

This PR checks if the dir is not an empty string before calling os.MkdirAll(dir, 0750).

@GordonTheTurtle
Copy link

Please sign your commits following these rules:
https://github.com/moby/moby/blob/master/CONTRIBUTING.md#sign-your-work
The easiest way to do this is to amend the last commit:

$ git clone -b "master" [email protected]:vishen/libkv.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f

Amending updates the existing PR. You DO NOT need to open a new one.

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

Successfully merging this pull request may close these issues.

2 participants