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

Sort vault_policy_document allowed/denied parameters by key name #656

Conversation

martinssipenko
Copy link
Contributor

Community Note

  • Please vote on this pull request by adding a 👍 reaction to the original pull request comment to help the community and maintainers prioritize this request
  • Please do not leave "+1" comments, they generate extra noise for pull request followers and do not help prioritize the request

Description

When running terraform plan, terraform produces false positive changes because Go iterates maps in randomized order. This change adds sorting by keys name values to overcome randomness.

Release note for CHANGELOG:

Sort `vault_policy_document` data source allowed/denied parameters by key name.

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestDataSourcePolicyDocument'
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test $(go list ./... |grep -v 'vendor') -v -run=TestDataSourcePolicyDocument -timeout 120m
?   	github.com/terraform-providers/terraform-provider-vault	[no test files]
?   	github.com/terraform-providers/terraform-provider-vault/cmd/coverage	[no test files]
testing: warning: no tests to run
PASS
ok  	github.com/terraform-providers/terraform-provider-vault/util	(cached) [no tests to run]
=== RUN   TestDataSourcePolicyDocument
--- PASS: TestDataSourcePolicyDocument (0.15s)
PASS
ok  	github.com/terraform-providers/terraform-provider-vault/vault	(cached)
...

Copy link
Contributor

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Choose a reason for hiding this comment

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

Nice! Thank you for fixing this!

@tyrannosaurus-becks tyrannosaurus-becks merged commit fef5ab8 into hashicorp:master Jan 31, 2020
@martinssipenko martinssipenko deleted the vault_policy_document_sort branch January 31, 2020 21:19
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants