Skip to content

Commit 22935ed

Browse files
committed
put routes under experiment
1 parent d435546 commit 22935ed

File tree

3 files changed

+13
-4
lines changed

3 files changed

+13
-4
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6551,6 +6551,7 @@ func (q *FakeQuerier) InsertProvisionerKey(_ context.Context, arg database.Inser
65516551
}
65526552
}
65536553

6554+
//nolint:gosimple
65546555
provisionerKey := database.ProvisionerKey{
65556556
ID: arg.ID,
65566557
CreatedAt: arg.CreatedAt,

enterprise/coderd/coderd.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,7 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
259259
apiKeyMiddleware,
260260
httpmw.ExtractOrganizationParam(api.Database),
261261
api.RequireFeatureMW(codersdk.FeatureMultipleOrganizations),
262+
httpmw.RequireExperiment(api.AGPL.Experiments, codersdk.ExperimentMultiOrganization),
262263
)
263264
r.Get("/", api.provisionerKeys)
264265
r.Post("/", api.postProvisionerKey)

enterprise/coderd/provisionerkeys_test.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,18 @@ func TestProvisionerKeys(t *testing.T) {
1919

2020
ctx, cancel := context.WithTimeout(context.Background(), testutil.WaitLong*10)
2121
t.Cleanup(cancel)
22-
client, owner := coderdenttest.New(t, &coderdenttest.Options{LicenseOptions: &coderdenttest.LicenseOptions{
23-
Features: license.Features{
24-
codersdk.FeatureMultipleOrganizations: 1,
22+
dv := coderdtest.DeploymentValues(t)
23+
dv.Experiments = []string{string(codersdk.ExperimentMultiOrganization)}
24+
client, owner := coderdenttest.New(t, &coderdenttest.Options{
25+
Options: &coderdtest.Options{
26+
DeploymentValues: dv,
2527
},
26-
}})
28+
LicenseOptions: &coderdenttest.LicenseOptions{
29+
Features: license.Features{
30+
codersdk.FeatureMultipleOrganizations: 1,
31+
},
32+
},
33+
})
2734
orgAdmin, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID, rbac.ScopedRoleOrgAdmin(owner.OrganizationID))
2835
member, _ := coderdtest.CreateAnotherUser(t, client, owner.OrganizationID)
2936
otherOrg := coderdtest.CreateOrganization(t, client, coderdtest.CreateOrganizationOptions{})

0 commit comments

Comments
 (0)