Skip to content

Sort vault_policy_document allowed/denied parameters by key name - #656

Merged
tyrannosaurus-becks merged 1 commit into
hashicorp:masterfrom
martinssipenko:vault_policy_document_sort
Jan 31, 2020
Merged

Sort vault_policy_document allowed/denied parameters by key name#656
tyrannosaurus-becks merged 1 commit into
hashicorp:masterfrom
martinssipenko:vault_policy_document_sort

Conversation

@martinssipenko

Copy link
Copy Markdown
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)
...

@ghost ghost added the size/S label Jan 22, 2020
@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Jan 31, 2020

@tyrannosaurus-becks tyrannosaurus-becks left a comment

Copy link
Copy Markdown
Contributor

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