mirror of
https://github.com/coder/coder.git
synced 2025-07-06 15:41:45 +00:00
WIP CODER_AGENT_TOKEN reuse
Signed-off-by: Danny Kopping <danny@coder.com>
This commit is contained in:
@ -73,6 +73,7 @@ type Builder struct {
|
||||
parameterNames *[]string
|
||||
parameterValues *[]string
|
||||
prebuild bool
|
||||
runningWorkspaceAgentID uuid.UUID
|
||||
|
||||
verifyNoLegacyParametersOnce bool
|
||||
}
|
||||
@ -175,6 +176,13 @@ func (b Builder) MarkPrebuild() Builder {
|
||||
return b
|
||||
}
|
||||
|
||||
// RunningWorkspaceAgentID is only used for prebuilds; see the associated field in `provisionerdserver.WorkspaceProvisionJob`.
|
||||
func (b Builder) RunningWorkspaceAgentID(id uuid.UUID) Builder {
|
||||
// nolint: revive
|
||||
b.runningWorkspaceAgentID = id
|
||||
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.
|
||||
@ -300,9 +308,10 @@ func (b *Builder) buildTx(authFunc func(action policy.Action, object rbac.Object
|
||||
|
||||
workspaceBuildID := uuid.New()
|
||||
input, err := json.Marshal(provisionerdserver.WorkspaceProvisionJob{
|
||||
WorkspaceBuildID: workspaceBuildID,
|
||||
LogLevel: b.logLevel,
|
||||
IsPrebuild: b.prebuild,
|
||||
WorkspaceBuildID: workspaceBuildID,
|
||||
LogLevel: b.logLevel,
|
||||
IsPrebuild: b.prebuild,
|
||||
RunningWorkspaceAgentID: b.runningWorkspaceAgentID,
|
||||
})
|
||||
if err != nil {
|
||||
return nil, nil, nil, BuildError{
|
||||
|
Reference in New Issue
Block a user