-
Notifications
You must be signed in to change notification settings - Fork 943
feat: track resource replacements when claiming a prebuilt workspace #17571
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 from 14 commits
b32923a
0b0830f
256395a
61ef61a
a66559f
222892b
f34e011
5168c01
41e5e0c
b29e8fa
b31ed5e
adf98d2
f24aef0
70f9a53
1e8385d
d0f00ce
11a2c5a
ce63b24
d2c5d43
22d82a4
5209aae
39ce658
ac5655f
82c3f58
7577a90
a893b79
d9c906a
471198a
7d694e6
6b7a8b7
5df2cb3
6d1c3ea
5f62702
f74d799
971f65c
bc362b0
4fbd356
b9eb8be
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
DELETE FROM notification_templates WHERE id = '89d9745a-816e-4695-a17f-3d0a229e2b8d'; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
INSERT INTO notification_templates | ||
(id, name, title_template, body_template, "group", actions) | ||
VALUES ('89d9745a-816e-4695-a17f-3d0a229e2b8d', | ||
'Prebuilt Workspace Resource Replaced', | ||
E'There might be a problem with a recently claimed prebuilt workspace', | ||
$$ | ||
Workspace **{{.Labels.workspace}}** was claimed from a prebuilt workspace by **{{.Labels.claimant}}**. | ||
|
||
During the claim, Terraform destroyed and recreated the following resources | ||
because one or more immutable attributes changed: | ||
mafredri marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
{{range $resource, $paths := .Data.replacements -}} | ||
- _{{ $resource }}_ was replaced due to changes to _{{ $paths }}_ | ||
dannykopping marked this conversation as resolved.
Show resolved
Hide resolved
|
||
{{end}} | ||
|
||
When Terraform must change an immutable attribute, it replaces the entire resource. | ||
If you’re using prebuilds to speed up provisioning, unexpected replacements will slow down | ||
workspace startup—even when claiming a prebuilt environment. | ||
|
||
For tips on preventing replacements and improving claim performance, see [this guide](https://coder.com/docs/admin/templates/extending-templates/prebuilt-workspaces.md#preventing-resource-replacement). | ||
dannykopping marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
NOTE: this prebuilt workspace used the **{{.Labels.preset}}** preset. | ||
$$, | ||
'Template Events', | ||
'[ | ||
{ | ||
"label": "View workspace build", | ||
"url": "{{base_url}}/@{{.Labels.claimant}}/{{.Labels.workspace}}/builds/{{.Labels.workspace_build_num}}" | ||
}, | ||
{ | ||
"label": "View template version", | ||
"url": "{{base_url}}/templates/{{.Labels.org}}/{{.Labels.template}}/versions/{{.Labels.template_version}}" | ||
} | ||
]'::jsonb); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Uh oh!
There was an error while loading. Please reload this page.