-
Notifications
You must be signed in to change notification settings - Fork 102
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
[TF-9914] Add auto destroy attribute to workspaces #786
Conversation
a7b3d3b
to
484fbd7
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 have questions about this one before I can approve it! (And if there's good answers already, I'll probably push to get them into docs for this attribute.)
From a glance at the workspace api docs, it seems this is a field where a string value means auto-destroy is turned on (with the value of the string being the deadline), but a null
value means auto-destroy is turned OFF.
I presume this is why the field on the Workspace struct is a *time.Time
pointer instead of a value like the other times!
But: how do I turn auto-destroy off for a workspace?
In the CreateOptions / UpdateOptions structs, you've set the field to omitempty
for the serializer, so would a nil pointer do nothing? It seems like it might be impossible to turn it off once it's turned on.
I haven't tested this yet! If I'm wrong, please add a new integration test demonstrating turning auto-destroy on and off again.
71d716d
to
770790f
Compare
Removed |
770790f
to
229f357
Compare
it seems like there are maybe two ways that I can think of to do this (also open to suggestions):
let me know if there's another route we should take. to fix linting I'd probably break the Sprintf calls for |
b6054e7
to
7804240
Compare
8284226
to
bdfd01a
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.
This pretty much has my approval pending updating the changelog entry. Comments with 💅 are entirely optional.
Really nice work 🔥
a95fd40
to
2ce33d0
Compare
16e37c0
to
f6e82ff
Compare
7e461b8
to
bf4c87c
Compare
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
Updates
Workspaces
to include theAutoDestroyAt
attribute. This attribute is settable on create and update.Adds a
Time
receiver to the existing type helpers.Adds an
Nullable
generic type with custom marshaling to allow updates to attributes which use significantnull
values, but which also requireomitempty
behavior.Testing plan
Updated workspace integration tests
External links
Output from tests
Including output from tests may require access to a TFE instance. Ignore this section if you have no environment to test against.