Skip to content

Fix vault:reconfigure fails running vault commands

Kev Kloss requested to merge kkloss-vault-reconfigure-shellout into main

What does this merge request do and why?

This MR fixes that the rake command vault:reconfigure errors with the following shellout error:

rake aborted!
TypeError: no implicit conversion of Hash into String (TypeError)

    pid = spawn(*cmd, opts)
                ^^^^^^^^^^
/Users/kev/development/gitlab/gitlab-development-kit/lib/shellout.rb:74:in `stream'
/Users/kev/development/gitlab/gitlab-development-kit/lib/shellout.rb:35:in `block in execute'
/Users/kev/development/gitlab/gitlab-development-kit/lib/shellout.rb:34:in `execute'
/Users/kev/development/gitlab/gitlab-development-kit/lib/gdk/vault.rb:67:in `shellout'
/Users/kev/development/gitlab/gitlab-development-kit/lib/gdk/vault.rb:11:in `create_test_secret'
/Users/kev/development/gitlab/gitlab-development-kit/lib/tasks/vault.rake:11:in `block (2 levels) in <top (required)>'
/Users/kev/.local/share/mise/installs/ruby/3.2.3/bin/bundle:25:in `load'
/Users/kev/.local/share/mise/installs/ruby/3.2.3/bin/bundle:25:in `<main>'
Tasks: TOP => vault:configure
(See full trace by running task with --trace)

How to set up and validate locally

  1. Run gdk config set vault.enabled true
  2. Run gdk reconfigure
  3. Run the vault:configure rake as per the docs in doc/howto/hashicorp_vault.md
  4. See that the vault commands are executed instead of the error above

Impacted categories

The following categories relate to this merge request:

Merge request checklist

  • This change is backward compatible. If not, please include steps to communicate to our users.
  • Tests added for new functionality. If not, please raise an issue to follow-up.
  • Documentation added/updated, if needed.
  • Announcement added, if change is notable.
  • gdk doctor test added, if needed.
  • Add the ~highlight label if this MR should be included in the CHANGELOG.md.

Merge request reports