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

Adds options for mounts #196

Closed
wants to merge 2 commits into from
Closed

Conversation

petems
Copy link
Contributor

@petems petems commented Dec 19, 2018

  • Allows us to check what kv version is mounted
  • Also allows us to retrieve options from existing
    mounts
  • Restricts to 0.10+ for specs

Closes #195

payload = { type: type }
# @param [String] options
# mount type specific options that are passed to the backend (optional)
def mount(path, type, description = nil, options = {})
Copy link

Choose a reason for hiding this comment

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

prefer that options includes :description ... maybe some fallback if options is not a hash, then treat it as description

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure I understand this comment, do you mean that options contains a description? Or to remove the extra attribute?

Copy link

Choose a reason for hiding this comment

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

both :D

def mount(path, type, options = {})
  description = (options.is_a?(Hash) ? options[:description] : options)

lib/vault/api/sys/mount.rb Outdated Show resolved Hide resolved
lib/vault/api/sys/mount.rb Outdated Show resolved Hide resolved
lib/vault/api/sys/mount.rb Outdated Show resolved Hide resolved
it "returns the options from a mount" do
next unless has_options_for_mount?

expect(subject.mount("kv_v2_mount", "kv", 'kv v2 mount', options: {version: "2"})).to be(true)
Copy link

Choose a reason for hiding this comment

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

isn't this supposed to be

Suggested change
expect(subject.mount("kv_v2_mount", "kv", 'kv v2 mount', options: {version: "2"})).to be(true)
expect(subject.mount("kv_v2_mount", "kv", 'kv v2 mount', version: "2")).to be(true)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nope, it's an options hash containing the entry of version . AFAIK :https://www.vaultproject.io/api/system/mounts.html#options

@maxadamo
Copy link

will anyone push the merge button? 😺

* Allows us to check what kv version is mounted
* Also allows us to retrieve options from existing
mounts
* Restricts to 0.10+ for specs
* Adds readline for pry
* Detect if VAULT_VERSION is unset
* Change to the latest 3 releases in Travis
@petems petems closed this Dec 15, 2019
@petems petems deleted the add_options_to_mounts branch December 15, 2019 17:06
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.

Enhancement: Support options field on /sys/mounts
3 participants