mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
chore(coderd): move provisionerd tags to provisionersdk (#11100)
This commit is contained in:
@@ -10,6 +10,8 @@ import (
|
||||
"net/http"
|
||||
"time"
|
||||
|
||||
"github.com/coder/coder/v2/provisionersdk"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/sqlc-dev/pqtype"
|
||||
"golang.org/x/xerrors"
|
||||
@@ -294,7 +296,7 @@ func (b *Builder) buildTx(authFunc func(action rbac.Action, object rbac.Objecter
|
||||
if err != nil {
|
||||
return nil, nil, BuildError{http.StatusInternalServerError, "marshal metadata", err}
|
||||
}
|
||||
tags := provisionerdserver.MutateTags(b.workspace.OwnerID, templateVersionJob.Tags)
|
||||
tags := provisionersdk.MutateTags(b.workspace.OwnerID, templateVersionJob.Tags)
|
||||
|
||||
now := dbtime.Now()
|
||||
provisionerJob, err := b.store.InsertProvisionerJob(b.ctx, database.InsertProvisionerJobParams{
|
||||
|
||||
@@ -8,6 +8,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/coder/coder/v2/provisionersdk"
|
||||
|
||||
"github.com/golang/mock/gomock"
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/assert"
|
||||
@@ -690,8 +692,8 @@ func withActiveVersion(params []database.TemplateVersionParameter) func(mTx *dbm
|
||||
Type: database.ProvisionerJobTypeTemplateVersionImport,
|
||||
Input: nil,
|
||||
Tags: database.StringMap{
|
||||
"version": "active",
|
||||
provisionerdserver.TagScope: provisionerdserver.ScopeUser,
|
||||
"version": "active",
|
||||
provisionersdk.TagScope: provisionersdk.ScopeUser,
|
||||
},
|
||||
FileID: activeFileID,
|
||||
StartedAt: sql.NullTime{Time: dbtime.Now(), Valid: true},
|
||||
@@ -730,8 +732,8 @@ func withInactiveVersion(params []database.TemplateVersionParameter) func(mTx *d
|
||||
Type: database.ProvisionerJobTypeTemplateVersionImport,
|
||||
Input: nil,
|
||||
Tags: database.StringMap{
|
||||
"version": "inactive",
|
||||
provisionerdserver.TagScope: provisionerdserver.ScopeUser,
|
||||
"version": "inactive",
|
||||
provisionersdk.TagScope: provisionersdk.ScopeUser,
|
||||
},
|
||||
FileID: inactiveFileID,
|
||||
StartedAt: sql.NullTime{Time: dbtime.Now(), Valid: true},
|
||||
|
||||
Reference in New Issue
Block a user