()
| 672 | } |
| 673 | |
| 674 | func (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). |
no test coverage detected