mirror of
https://github.com/coder/coder.git
synced 2025-07-13 21:36:50 +00:00
Add provision job metadata to identify prebuilds
Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
@ -72,6 +72,7 @@ type Builder struct {
|
||||
lastBuildJob *database.ProvisionerJob
|
||||
parameterNames *[]string
|
||||
parameterValues *[]string
|
||||
prebuild bool
|
||||
|
||||
verifyNoLegacyParametersOnce bool
|
||||
}
|
||||
@ -168,6 +169,12 @@ func (b Builder) RichParameterValues(p []codersdk.WorkspaceBuildParameter) Build
|
||||
return b
|
||||
}
|
||||
|
||||
func (b Builder) MarkPrebuild() Builder {
|
||||
// nolint: revive
|
||||
b.prebuild = true
|
||||
return b
|
||||
}
|
||||
|
||||
// SetLastWorkspaceBuildInTx prepopulates the Builder's cache with the last workspace build. This allows us
|
||||
// to avoid a repeated database query when the Builder's caller also needs the workspace build, e.g. auto-start &
|
||||
// auto-stop.
|
||||
@ -295,6 +302,7 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object
|
||||
input, err := json.Marshal(provisionerdserver.WorkspaceProvisionJob{
|
||||
WorkspaceBuildID: workspaceBuildID,
|
||||
LogLevel: b.logLevel,
|
||||
IsPrebuild: b.prebuild,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, nil, BuildError{
|
||||
|
Reference in New Issue
Block a user