-
Notifications
You must be signed in to change notification settings - Fork 160
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 support for policy tool version in terraform providers #1202
Conversation
204051c
to
0cbaba5
Compare
161c478
to
358346d
Compare
c9ef114
to
c15c25c
Compare
|
||
d.SetId(v.ID) | ||
|
||
return resourceTFEOPAVersionUpdate(d, meta) |
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.
By convention, our Create
and Update
methods generally return the Read
method. Can you share more about why this method returns Update
?
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.
Well... 😅 I was trying to follow the same approach as tfe_terraform_version provider as the policy version providers should be similar. Underneath the hood, they use the same tool_version code in atlas.
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 briefly looked into it, and I think tfe_terraform_version
is in error here (probably just a typo) and all three resources should be returning a Read. Sorry for the misleading crib sheet!
|
||
d.SetId(v.ID) | ||
|
||
return resourceTFESentinelVersionUpdate(d, meta) |
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.
Same here. Can you share more about why this method returns Update
instead of Read
?
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.
same as above ^ #1202 (comment)
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.
Great work! Can you provide instructions on how to smoke test this?
Smoke test instructions:
|
da020b6
to
ad56edf
Compare
Results of smoke test: Ensure your admin user has version_maintaince role to be able to successfully hit the API's:
|
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.
All right, this is in good shape!
I ran into one piece of comedy while smoke testing -- it requires deprecated_reason
to be present when creating a resource, but you can leave it blank when updating an existing one. But I think that's probably an atlas bug, I can't see any issue in this code that would have caused it.
I have two change requests:
- Please return Read from Create (sorry, the other resource just seems to be in error).
- Please add a note to the docs,
just because the site admin stuff is such a hazard.
|
||
d.SetId(v.ID) | ||
|
||
return resourceTFEOPAVersionUpdate(d, meta) |
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 briefly looked into it, and I think tfe_terraform_version
is in error here (probably just a typo) and all three resources should be returning a Read. Sorry for the misleading crib sheet!
9547113
to
f7e759b
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.
Noticed one more thing that wants adjustment before merge. Apologies again for not noticing that before!
8915a0d
to
4d0e6c2
Compare
4d0e6c2
to
afb5cc2
Compare
I followed up with mrinali and it looks like we caught all that feedback.
Description
Add support in the tfe provider for sentinel and OPA versions
Remember to:
Output from acceptance tests
Sentinel tests:
Test Config:
ENABLE_TFE=1;TF_ACC=1;TFE_HOSTNAME=tfcdev-1dfef877.au.ngrok.io;TFE_TOKEN=REDACTED
OPA Tests:
Website Preview: