refactor(cli): use codersdk for provisioner types (#9508)

This change removes one use of `coderd/database` from the slim binary
and more correctly uses codersdk instead of database or provisionerd
packages.

No size change (yet).

Ref: #9380
This commit is contained in:
Mathias Fredriksson
2023-09-04 21:42:15 +03:00
committed by GitHub
parent 39e3b049a5
commit b240799f47
4 changed files with 15 additions and 14 deletions
+7
View File
@@ -17,6 +17,7 @@ import (
"nhooyr.io/websocket"
"github.com/coder/coder/v2/provisionerd/proto"
"github.com/coder/coder/v2/provisionerd/runner"
"github.com/coder/coder/v2/provisionersdk"
)
@@ -72,6 +73,12 @@ const (
RequiredTemplateVariables JobErrorCode = "REQUIRED_TEMPLATE_VARIABLES"
)
// JobIsMissingParameterErrorCode returns whether the error is a missing parameter error.
// This can indicate to consumers that they should check parameters.
func JobIsMissingParameterErrorCode(code JobErrorCode) bool {
return string(code) == runner.MissingParameterErrorCode
}
// ProvisionerJob describes the job executed by the provisioning daemon.
type ProvisionerJob struct {
ID uuid.UUID `json:"id" format:"uuid"`