MCPcopy Create free account
hub / github.com/coder/coder / pushEmptyTemplateVersion

Method pushEmptyTemplateVersion

scaletest/prebuilds/run.go:386–397  ·  view source on GitHub ↗

pushEmptyTemplateVersion pushes a new empty template version (no presets, no prebuilds) and makes it active. This stops the reconciler from spawning new prebuild workspaces for the template.

(ctx context.Context)

Source from the content-addressed store, hash-verified

384// prebuilds) and makes it active. This stops the reconciler from spawning new
385// prebuild workspaces for the template.
386func (r *Runner) pushEmptyTemplateVersion(ctx context.Context) error {
387 emptyVersion, err := r.createTemplateVersion(ctx, r.template.ID, 0, 0)
388 if err != nil {
389 return xerrors.Errorf("create empty template version: %w", err)
390 }
391 if err = r.client.UpdateActiveTemplateVersion(ctx, r.template.ID, codersdk.UpdateActiveTemplateVersion{
392 ID: emptyVersion.ID,
393 }); err != nil {
394 return xerrors.Errorf("update active template version: %w", err)
395 }
396 return nil
397}
398
399func (r *Runner) Cleanup(ctx context.Context, _ string, logs io.Writer) error {
400 logs = loadtestutil.NewSyncWriter(logs)

Callers 1

RunMethod · 0.95

Calls 3

createTemplateVersionMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected