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 wrong response data from gcp_auth_backend_role read request #243

Merged
merged 5 commits into from
Jan 29, 2019

Conversation

Phylu
Copy link
Contributor

@Phylu Phylu commented Nov 15, 2018

As of hashicorp/vault-plugin-auth-gcp@438b86d, the role_type field has been changed to type.

This pull request should resolve #228.

@ghost ghost added the size/XS label Nov 15, 2018
@Phylu
Copy link
Contributor Author

Phylu commented Nov 15, 2018

Tests seem to fail as the vault version used in the tests (0.11.1) is before the change which renamed the field in vault.

@OperationalDev
Copy link
Contributor

Tests pass with Vault v1.0.0-beta2.

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.

@Phylu thanks for working on this! Should be good to after we handle compatibility issues.

vault/resource_gcp_auth_backend_role.go Outdated Show resolved Hide resolved
@tyrannosaurus-becks tyrannosaurus-becks self-assigned this Dec 10, 2018
@tyrannosaurus-becks
Copy link
Contributor

Saw you pushed some code! I noticed there's a test failure that looks related:

--- FAIL: TestGCPAuthBackendRole_gce (0.06s)
    testing.go:434: Step 0 error: Check failed: Expected type (type in state) of "auth/tf-test-gcp-backend-3800239246745760615/role/tf-test-gcp-role-294652960337314985" to be "gce", got %!q(<nil>)

@Phylu
Copy link
Contributor Author

Phylu commented Dec 12, 2018

The latest changes fix the failing acceptance tests. I had to revert the change that I made to the test where I renamed the expected attribute as well. This might be needed to change, later when the tests run with a newer version of vault.

@tyrannosaurus-becks
Copy link
Contributor

@Phylu oddly I now get the following error when I try to run that test on this branch:

./resource_aws_secret_backend_role.go:48:5: cannot use util.JsonDiffSuppress (type func(string, string, string, *"github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/schema".ResourceData) bool) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/schema".SchemaDiffSuppressFunc in field value
./resource_aws_secret_backend_role_test.go:33:36: cannot use util.TestCheckResourceAttrJSON("vault_aws_secret_backend_role.test_policy_inline", "policy", testAccAWSSecretBackendRolePolicyInline_basic) (type "github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc in argument to "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".ComposeTestCheckFunc
./resource_aws_secret_backend_role_test.go:44:36: cannot use util.TestCheckResourceAttrJSON("vault_aws_secret_backend_role.test_policy_inline", "policy", testAccAWSSecretBackendRolePolicyInline_updated) (type "github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc in argument to "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".ComposeTestCheckFunc
./resource_aws_secret_backend_role_test.go:68:36: cannot use util.TestCheckResourceAttrJSON("vault_aws_secret_backend_role.test_policy_inline", "policy", testAccAWSSecretBackendRolePolicyInline_basic) (type "github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc in argument to "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".ComposeTestCheckFunc
./resource_aws_secret_backend_role_test.go:102:36: cannot use util.TestCheckResourceAttrJSON("vault_aws_secret_backend_role.test_policy_inline", "policy", testAccAWSSecretBackendRolePolicyInline_basic) (type "github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc in argument to "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".ComposeTestCheckFunc
./resource_aws_secret_backend_role_test.go:113:36: cannot use util.TestCheckResourceAttrJSON("vault_aws_secret_backend_role.test_policy_inline", "policy", testAccAWSSecretBackendRolePolicyInline_updated) (type "github.com/terraform-providers/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc) as type "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".TestCheckFunc in argument to "github.com/Phylu/terraform-provider-vault/vendor/github.com/hashicorp/terraform/helper/resource".ComposeTestCheckFunc

I think the current master branch of the Terraform Vault Provider may just need to be merged in.

@Phylu
Copy link
Contributor Author

Phylu commented Dec 18, 2018

That is very strange. Might it be an issue if you ran the tests in my repository, as some links to files in the vendor folder might be wrong?

I just merged the current master and ran the acceptance tests again and everything seems fine. Let's see what travis says here. If I can do anything more, just let me know.

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.

@Phylu yes, it did turn out to be an issue with my test environment. Thank you! This is looking fantastic and all tests are passing.

@tyrannosaurus-becks tyrannosaurus-becks merged commit 0ae40a4 into hashicorp:master Jan 29, 2019
@Phylu
Copy link
Contributor Author

Phylu commented Jan 30, 2019

@Phylu yes, it did turn out to be an issue with my test environment. Thank you! This is looking fantastic and all tests are passing.

Nice. Thanks!

@Phylu Phylu deleted the fix-gcp-auth-backend-role branch January 30, 2019 11:59
dandandy pushed a commit to dandandy/terraform-provider-vault that referenced this pull request Jun 17, 2021
Fix wrong response data from gcp_auth_backend_role read request
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.

Terraform wants to re-create vault_gcp_auth_backend_role every time
3 participants