-
Notifications
You must be signed in to change notification settings - Fork 103
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
Changes to Policy set API for PPRV #752
Conversation
63b6f80
to
27f1717
Compare
d8bcdc1
to
4722fe7
Compare
4722fe7
to
e44d618
Compare
493c5b1
to
37e1663
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't fully reviewed the code yet, but there was one glaring problem (in multiple places) that jumped out at me, and I wanted to send it back to you as soon as I could. I'll take another look once you've got that sorted out!
31d8e2d
to
0634384
Compare
424c1c1
to
e90f6c0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, this is mostly looking good, other than one missing omitempty. My only other real concern at this point is making sure the doc comments are easy to understand. Comments inline.
Reminder to the contributor that merged this PR: if your changes have added important functionality or fixed a relevant bug, open a follow-up PR to update CHANGELOG.md with a note on your changes. |
Description
Add support to the go-tfe client for creating sentinel policy sets that will be run within the agent against a pinned policy tool version. FYI:
Pinned Policy Runtime version
is now GA.It also removes beta tags from old OPA tests as OPA is now in GA
Api's updated:
Policy set creation (Adds agent-enabled + policy-tool-version attribute)
Testing plan
Integration tests added
External links
JIRA
Output from tests
Needs the following env vars:
TFE_ADDRESS
TFE_TOKEN
Set ENABLE_BETA=1
envchain staging go test -run TestPolicySetsCreate -v ./... -tags=integration
=== RUN TestPolicySetsCreate
=== RUN TestPolicySetsCreate/with_valid_attributes
=== RUN TestPolicySetsCreate/with_kind_missing
=== RUN TestPolicySetsCreate/with_agent_enabled_missing
--- PASS: TestPolicySetsCreate (1.45s)
--- PASS: TestPolicySetsCreate/with_valid_attributes (0.25s)
--- PASS: TestPolicySetsCreate/with_kind_missing (0.32s)
--- PASS: TestPolicySetsCreate/with_agent_enabled_missing (0.23s)
PASS
ok github.com/hashicorp/go-tfe 2.317s
? github.com/hashicorp/go-tfe/examples/configuration_versions [no test files]
? github.com/hashicorp/go-tfe/examples/organizations [no test files]
? github.com/hashicorp/go-tfe/examples/registry_modules [no test files]
? github.com/hashicorp/go-tfe/examples/state_versions [no test files]
? github.com/hashicorp/go-tfe/examples/users [no test files]
? github.com/hashicorp/go-tfe/examples/workspaces [no test files]
? github.com/hashicorp/go-tfe/mocks [no test files]
envchain staging go test -run TestPolicySetsUpdate -v ./... -tags=integration
=== RUN TestPolicySetsUpdate
=== RUN TestPolicySetsUpdate/with_valid_attributes
--- PASS: TestPolicySetsUpdate (1.61s)
--- PASS: TestPolicySetsUpdate/with_valid_attributes (0.30s)
PASS
ok github.com/hashicorp/go-tfe 2.301s
? github.com/hashicorp/go-tfe/examples/configuration_versions [no test files]
? github.com/hashicorp/go-tfe/examples/organizations [no test files]
? github.com/hashicorp/go-tfe/examples/registry_modules [no test files]
? github.com/hashicorp/go-tfe/examples/state_versions [no test files]
? github.com/hashicorp/go-tfe/examples/users [no test files]
? github.com/hashicorp/go-tfe/examples/workspaces [no test files]
? github.com/hashicorp/go-tfe/mocks [no test files]
envchain staging go test -run TestPolicySetsList -v ./... -tags=integration
=== RUN TestPolicySetsList
=== RUN TestPolicySetsList/without_list_options
--- PASS: TestPolicySetsList (2.90s)
--- PASS: TestPolicySetsList/without_list_options (0.51s)
PASS
ok github.com/hashicorp/go-tfe 3.726s
? github.com/hashicorp/go-tfe/examples/configuration_versions [no test files]
? github.com/hashicorp/go-tfe/examples/organizations [no test files]
? github.com/hashicorp/go-tfe/examples/registry_modules [no test files]
? github.com/hashicorp/go-tfe/examples/state_versions [no test files]
? github.com/hashicorp/go-tfe/examples/users [no test files]
? github.com/hashicorp/go-tfe/examples/workspaces [no test files]
? github.com/hashicorp/go-tfe/mocks [no test files]