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

Support for key_file fstab option #182

Merged
merged 3 commits into from
Aug 15, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions docs/mounting.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ Console:

GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json gcsfuse [...]

When mounting with an fstab entry, you can use the `key_file` option. For example:

my-bucket /mount/point gcsfuse rw,noauto,user,key_file=/path/to/key.json

[gce]: https://cloud.google.com/compute/
[gce-service-accounts]: https://cloud.google.com/compute/docs/authentication
[gcloud tool]: https://cloud.google.com/sdk/gcloud/
Expand Down Expand Up @@ -97,6 +101,7 @@ with dashes instead of underscores:
* `implicit_dirs`
* `dir_mode`
* `file_mode`
* `key_file`

On both OS X and Linux, you can also add entries to your `/etc/fstab` file like
the following:
Expand Down
8 changes: 8 additions & 0 deletions tools/mount_gcsfuse/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ func makeGcsfuseArgs(
"--"+strings.Replace(name, "_", "-", -1),
)

// Special case: support mount-like formatting for gcsfuse string flags.
case "key_file":
args = append(
args,
"--"+strings.Replace(name, "_", "-", -1),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please run gofmt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did. Double-checked that now.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My apologies, I had misjudged what gofmt would do here. Thanks!

value,
)

// Special case: support mount-like formatting for gcsfuse string flags.
case "dir_mode", "file_mode":
args = append(
Expand Down