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

Vault init broken in 1.12.0 #7

Closed
acidprime opened this issue Nov 1, 2022 · 2 comments
Closed

Vault init broken in 1.12.0 #7

acidprime opened this issue Nov 1, 2022 · 2 comments

Comments

@acidprime
Copy link

acidprime commented Nov 1, 2022

This PR was included in the latest release of vault
hashicorp/vault#16379

I belive it breaks this module as you are passing both params to the init every time.

I think the grey area here is you likely are passing them as 0 but (also see this test https://github.com/hashicorp/vault/blob/0d6a42c79ef765e919db486c1cb78e527b47e010/http/sys_init_test.go#L133-L150)

You can't have the params themselves in the request

Errors I'm seeing

Error: Error making API request.

URL: PUT http://127.0.0.1:8110/v1/sys/init
Code: 400. Errors:

* parameters recovery_shares,recovery_threshold not applicable to seal type shamir

  on ../modules/vault-transit/main.tf line 7, in resource "vaultoperator_init" "scenario_vault_init":
   7: resource "vaultoperator_init" "scenario_vault_init" {

for code

 resource "vaultoperator_init" "scenario_vault_init" {
   secret_shares    = 1
   secret_threshold = 1
 
   depends_on = [
     docker_container.scenario_vault_container,
     time_sleep.wait_for_vault_startup,
   ]
 
   lifecycle {
     ignore_changes = all
   }
 }

It errors on the params being in the request even though the are not included in the HCL

This is happening I believe because you use Get which makes an empty value be 0 for int

If the key does exist in the schema but doesn't exist in the configuration, then the default value for that type will be returned. For strings, this is "", for numbers it is 0, etc.

@acidprime
Copy link
Author

rickardgranberg added a commit that referenced this issue Nov 2, 2022
@rickardgranberg
Copy link
Owner

Thanks for troubleshooting and reporting this issue @acidprime
I will have a new version out in a few hours

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

No branches or pull requests

2 participants