Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

Merged
dannykopping merged 5 commits into
mainfrom
dk/is-prebuild-claim
May 12, 2025
Merged

feat: add is_prebuild_claim to distinguish post-claim provisioning#17757
dannykopping merged 5 commits into
mainfrom
dk/is-prebuild-claim

Conversation

@dannykopping

Copy link
Copy Markdown
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.

@spikecurtis spikecurtis left a comment

Copy link
Copy Markdown
Contributor

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.

Comment thread provisionersdk/proto/provisioner.proto Outdated
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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

@dannykopping
dannykopping enabled auto-merge (squash) May 12, 2025 14:06
@dannykopping
dannykopping merged commit af2941b into main May 12, 2025
@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