MCPcopy Index your code
hub / github.com/coder/coder / getTemplateVersionID

Method getTemplateVersionID

coderd/wsbuilder/wsbuilder.go:674–691  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

672}
673
674func (b *Builder) getTemplateVersionID() (uuid.UUID, error) {
675 if b.version.specific != nil {
676 return *b.version.specific, nil
677 }
678 if b.version.active {
679 t, err := b.getTemplate()
680 if err != nil {
681 return uuid.Nil, xerrors.Errorf("get template so we can get active version: %w", err)
682 }
683 return t.ActiveVersionID, nil
684 }
685 // default is prior version
686 bld, err := b.getLastBuild()
687 if err != nil {
688 return uuid.Nil, xerrors.Errorf("get last build so we can get version: %w", err)
689 }
690 return bld.TemplateVersionID, nil
691}
692
693// getWorkspaceTask returns the task associated with the workspace, if any.
694// If no task exists, it returns (nil, nil).

Callers 4

buildTxMethod · 0.95
getTemplateVersionMethod · 0.95

Calls 3

getTemplateMethod · 0.95
getLastBuildMethod · 0.95
ErrorfMethod · 0.45

Tested by

no test coverage detected