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

Add OPA support for policy sets #691

Merged
merged 10 commits into from Nov 28, 2022
Merged

Add OPA support for policy sets #691

merged 10 commits into from Nov 28, 2022

Conversation

mrinalirao
Copy link
Contributor

Description

Add OPA support to the tfe-provider for policy sets. OPA is still in beta phase.
The existing tfe_policy_set provider will allow for creation of both sentinel as well as OPA policies in the provider.

This is the second of the 3 PRs for adding OPA support:
Previous PRs: #690

Upcoming PRs

  • Update documentation

Testing plan

Acceptance tests added

External links

Include any links here that might be helpful for people reviewing your PR. If there are none, feel free to delete this section.

Output from acceptance tests

$ TESTARGS="-run TestAccTFEPolicySetOPA_basic" envchain staging make testacc

TF_ACC=1 TF_LOG_SDK_PROTO=OFF go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFEPolicySetOPA_basic -timeout 15m
?       github.com/hashicorp/terraform-provider-tfe     [no test files]
=== RUN   TestAccTFEPolicySetOPA_basic
    testing.go:181: Skipping test related to a Terraform Cloud/Enterprise beta feature. Set ENABLE_BETA=1 to run.
--- SKIP: TestAccTFEPolicySetOPA_basic (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-tfe/tfe 0.604s
?       github.com/hashicorp/terraform-provider-tfe/version     [no test files]

$ TESTARGS="-run TestAccTFEPolicySetDataSourceOPA_basic" envchain staging make testacc

TF_ACC=1 TF_LOG_SDK_PROTO=OFF go test $(go list ./... |grep -v 'vendor') -v -run TestAccTFEPolicySetDataSourceOPA_basic -timeout 15m
?       github.com/hashicorp/terraform-provider-tfe     [no test files]
=== RUN   TestAccTFEPolicySetDataSourceOPA_basic
    testing.go:181: Skipping test related to a Terraform Cloud/Enterprise beta feature. Set ENABLE_BETA=1 to run.
--- SKIP: TestAccTFEPolicySetDataSourceOPA_basic (0.00s)
PASS
ok      github.com/hashicorp/terraform-provider-tfe/tfe 0.272s
?       github.com/hashicorp/terraform-provider-tfe/version     [no test files]

@mrinalirao mrinalirao force-pushed the mr/TF-1451-policysets branch 6 times, most recently from 4a6b83f to 86b5c96 Compare November 16, 2022 05:25
Copy link
Collaborator

@brandonc brandonc left a comment

Choose a reason for hiding this comment

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

Found just the one issue with overridable.

tfe/resource_tfe_policy_set.go Show resolved Hide resolved
tfe/data_source_policy_set.go Outdated Show resolved Hide resolved
@mrinalirao
Copy link
Contributor Author

Added an acceptance test for setting overridable:

=== RUN   TestAccTFEPolicySet_updateOverridable
2022/11/29 09:32:08 [DEBUG] Configuring client for host "app.staging.terraform.io"
2022/11/29 09:32:08 [ERROR] Error reading CLI config or credentials file /Users/mrinalirao/.terraformrc: open /Users/mrinalirao/.terraformrc: no such file or directory
2022/11/29 09:32:08 [DEBUG] Service discovery for app.staging.terraform.io at https://app.staging.terraform.io/.well-known/terraform.json
--- PASS: TestAccTFEPolicySet_updateOverridable (24.11s)
PASS

@mrinalirao mrinalirao merged commit 1392f4a into main Nov 28, 2022
@mrinalirao mrinalirao deleted the mr/TF-1451-policysets branch November 28, 2022 22:52
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

Successfully merging this pull request may close these issues.

None yet

3 participants