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

Fix bug where some rabbitmq config changes trigger erroneous mount recreation. #1542

Merged
merged 5 commits into from
Jul 21, 2022

Conversation

jasonodonnell
Copy link
Contributor

@jasonodonnell jasonodonnell commented Jul 21, 2022

RabbitMQ backend resource is forcing the mount to be recreated when most config parameters have changed. It already supports in-place upgrades (tune and update), so just needed to flip the schema.

resource/rabbitmq_secret_backend: Fixed bug where changing config parameters would recreate the mount.

Acceptance tests:

[~/Git/terraform-provider-vault] VAULT_TOKEN=root RMQ_CONNECTION_URI="http://localhost:15672" RMQ_USERNAME="user" RMQ_PASSWORD="password" make testacc TESTARGS='-run TestAccRabbit'
=== RUN   TestAccRabbitMQSecretBackendRole_basic
--- PASS: TestAccRabbitMQSecretBackendRole_basic (6.82s)
=== RUN   TestAccRabbitMQSecretBackendRole_nested
--- PASS: TestAccRabbitMQSecretBackendRole_nested (6.85s)
=== RUN   TestAccRabbitMQSecretBackendRole_topic
--- PASS: TestAccRabbitMQSecretBackendRole_topic (6.85s)
=== RUN   TestAccRabbitMQSecretBackend_basic
--- PASS: TestAccRabbitMQSecretBackend_basic (6.77s)
=== RUN   TestAccRabbitMQSecretBackend_template
--- PASS: TestAccRabbitMQSecretBackend_template (5.60s)
PASS
ok  	github.com/hashicorp/terraform-provider-vault/vault	34.264s

Copy link
Contributor

@benashz benashz left a comment

Choose a reason for hiding this comment

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

Looks good, recommend not setting the ForceNew field rather than explicitly setting it.

vault/resource_rabbitmq_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_rabbitmq_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_rabbitmq_secret_backend.go Outdated Show resolved Hide resolved
vault/resource_rabbitmq_secret_backend.go Outdated Show resolved Hide resolved
@benashz benashz changed the title Fix bug where rabbitmq config changes deleted mount Fix bug where some rabbitmq config changes trigger erroneous mount recreation. Jul 21, 2022
@benashz benashz added this to the 3.8.0 milestone Jul 21, 2022
@jasonodonnell jasonodonnell merged commit c2ae1a2 into main Jul 21, 2022
@jasonodonnell jasonodonnell deleted the rabbit-config-forcenew-bug branch July 21, 2022 15:03
marcboudreau pushed a commit to marcboudreau/terraform-provider-vault that referenced this pull request Nov 6, 2022
…creation. (hashicorp#1542)

* Fix bug where rabbitmq config changes deleted mount

* Update vault/resource_rabbitmq_secret_backend.go

Co-authored-by: Ben Ash <[email protected]>

* Update vault/resource_rabbitmq_secret_backend.go

Co-authored-by: Ben Ash <[email protected]>

* Update vault/resource_rabbitmq_secret_backend.go

Co-authored-by: Ben Ash <[email protected]>

* Update vault/resource_rabbitmq_secret_backend.go

Co-authored-by: Ben Ash <[email protected]>

Co-authored-by: Ben Ash <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants