mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
feat: persist prebuild definitions on template import (#16951)
This PR allows provisioners to recognise and report prebuild definitions to the coder control plane. It also allows the coder control plane to then persist these to its store. closes https://github.com/coder/internal/issues/507 --------- Signed-off-by: Danny Kopping <dannykopping@gmail.com> Co-authored-by: Danny Kopping <dannykopping@gmail.com> Co-authored-by: evgeniy-scherbina <evgeniy.shcherbina.es@gmail.com>
This commit is contained in:
co-authored by
Danny Kopping
evgeniy-scherbina
parent
074ec2887d
commit
0b2b643ce2
@@ -6,6 +6,8 @@ import (
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/coder/coder/v2/coderd/prebuilds"
|
||||
|
||||
"github.com/google/uuid"
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
@@ -830,6 +832,9 @@ func TestGroup(t *testing.T) {
|
||||
_, user2 := coderdtest.CreateAnotherUser(t, client, user.OrganizationID)
|
||||
ctx := testutil.Context(t, testutil.WaitLong)
|
||||
|
||||
// nolint:gocritic // "This client is operating as the owner user" is fine in this case.
|
||||
prebuildsUser, err := client.User(ctx, prebuilds.SystemUserID.String())
|
||||
require.NoError(t, err)
|
||||
// The 'Everyone' group always has an ID that matches the organization ID.
|
||||
group, err := userAdminClient.Group(ctx, user.OrganizationID)
|
||||
require.NoError(t, err)
|
||||
@@ -838,6 +843,7 @@ func TestGroup(t *testing.T) {
|
||||
require.Equal(t, user.OrganizationID, group.OrganizationID)
|
||||
require.Contains(t, group.Members, user1.ReducedUser)
|
||||
require.Contains(t, group.Members, user2.ReducedUser)
|
||||
require.NotContains(t, group.Members, prebuildsUser.ReducedUser)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
package prebuilds
|
||||
Reference in New Issue
Block a user