Skip to content

feat: add is_prebuild_claim to distinguish post-claim provisioning #17757

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

Merged
merged 5 commits into from
May 12, 2025

Conversation

dannykopping
Copy link
Contributor

Used in combination with coder/terraform-provider-coder#396

This is required by both #17475 and #17571

Operators may need to conditionalize their templates to perform certain operations once a prebuilt workspace has been claimed. This value will only be set once a claim takes place and a subsequent terraform apply occurs. Any terraform apply runs thereafter will be indistinguishable from a normal run on a workspace.

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Copy link
Contributor

@spikecurtis spikecurtis left a comment

Choose a reason for hiding this comment

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

I've suggested a different name for the field, but I don't need to review again.

string running_workspace_agent_token = 21;
bool is_prebuild = 20; // Indicates that a prebuilt workspace is being built.
string running_workspace_agent_token = 21; // Preserves the running agent token of a prebuilt workspace so it can reinitialize.
bool is_prebuild_claim = 22; // Indicates that a prebuilt workspace is being claimed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
bool is_prebuild_claim = 22; // Indicates that a prebuilt workspace is being claimed.
bool claims_prebuilt_workspace = 22; // Indicates that a prebuilt workspace is being claimed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You're right; I probably shouldn't refer to "prebuild" here.
I'll make it is_prebuilt_workspace_claim to be similar in form to is_prebuild, since they're related fields.

Copy link
Contributor

Choose a reason for hiding this comment

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

You could make them a single enum...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Could work, lemme try it and see how it feels.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@spikecurtis great suggestion, this is more in line with how we do other things like workspace transitions; should've done this from the beginning.

bc9ff3d

Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
Signed-off-by: Danny Kopping <dannykopping@gmail.com>
@dannykopping dannykopping enabled auto-merge (squash) May 12, 2025 14:06
@dannykopping dannykopping merged commit af2941b into main May 12, 2025
37 checks passed
@dannykopping dannykopping deleted the dk/is-prebuild-claim branch May 12, 2025 14:19
@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants