Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0f5ec6b

Browse files
authored
Revert "feat: deployment flags (#4426)"
This reverts commitb1faaef.
1 parent6bc0390 commit0f5ec6b

File tree

11 files changed

+285
-950
lines changed

11 files changed

+285
-950
lines changed

‎cli/deployment/flags.go

Lines changed: 0 additions & 455 deletions
This file was deleted.

‎cli/root.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ import (
2222
"github.com/coder/coder/cli/cliflag"
2323
"github.com/coder/coder/cli/cliui"
2424
"github.com/coder/coder/cli/config"
25-
"github.com/coder/coder/cli/deployment"
2625
"github.com/coder/coder/coderd"
2726
"github.com/coder/coder/codersdk"
2827
)
@@ -99,9 +98,7 @@ func Core() []*cobra.Command {
9998
}
10099

101100
funcAGPL() []*cobra.Command {
102-
df:=deployment.Flags()
103-
all:=append(Core(),Server(df,func(_ context.Context,o*coderd.Options) (*coderd.API,error) {
104-
o.DeploymentFlags=&df
101+
all:=append(Core(),Server(func(_ context.Context,o*coderd.Options) (*coderd.API,error) {
105102
returncoderd.New(o),nil
106103
}))
107104
returnall

‎cli/server.go

Lines changed: 260 additions & 137 deletions
Large diffs are not rendered by default.

‎coderd/coderd.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,6 @@ type Options struct {
8282
MetricsCacheRefreshInterval time.Duration
8383
AgentStatsRefreshInterval time.Duration
8484
Experimentalbool
85-
DeploymentFlags*codersdk.DeploymentFlags
8685
}
8786

8887
// New constructs a Coder API handler.
@@ -260,10 +259,6 @@ func New(options *Options) *API {
260259
})
261260
})
262261
})
263-
r.Route("/flags",func(r chi.Router) {
264-
r.Use(apiKeyMiddleware)
265-
r.Get("/deployment",api.deploymentFlags)
266-
})
267262
r.Route("/audit",func(r chi.Router) {
268263
r.Use(
269264
apiKeyMiddleware,

‎coderd/coderdtest/coderdtest.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,6 @@ type Options struct {
8383
IncludeProvisionerDaemonbool
8484
MetricsCacheRefreshInterval time.Duration
8585
AgentStatsRefreshInterval time.Duration
86-
DeploymentFlags*codersdk.DeploymentFlags
8786
}
8887

8988
// New constructs a codersdk client connected to an in-memory API instance.
@@ -238,7 +237,6 @@ func NewOptions(t *testing.T, options *Options) (*httptest.Server, context.Cance
238237
AutoImportTemplates:options.AutoImportTemplates,
239238
MetricsCacheRefreshInterval:options.MetricsCacheRefreshInterval,
240239
AgentStatsRefreshInterval:options.AgentStatsRefreshInterval,
241-
DeploymentFlags:options.DeploymentFlags,
242240
}
243241
}
244242

‎coderd/flags.go

Lines changed: 0 additions & 18 deletions
This file was deleted.

‎coderd/flags_test.go

Lines changed: 0 additions & 47 deletions
This file was deleted.

‎coderd/rbac/object.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -133,11 +133,6 @@ var (
133133
ResourceLicense=Object{
134134
Type:"license",
135135
}
136-
137-
// ResourceDeploymentFlags
138-
ResourceDeploymentFlags=Object{
139-
Type:"deployment_flags",
140-
}
141136
)
142137

143138
// Object is used to create objects for authz checks when you have none in

‎codersdk/flags.go

Lines changed: 0 additions & 136 deletions
This file was deleted.

‎enterprise/cli/server.go

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,43 +5,44 @@ import (
55

66
"github.com/spf13/cobra"
77

8+
"github.com/coder/coder/cli/cliflag"
89
"github.com/coder/coder/cli/cliui"
9-
"github.com/coder/coder/cli/deployment"
1010
"github.com/coder/coder/enterprise/coderd"
1111

1212
agpl"github.com/coder/coder/cli"
1313
agplcoderd"github.com/coder/coder/coderd"
1414
)
1515

1616
funcserver()*cobra.Command {
17-
dflags:=deployment.Flags()
18-
cmd:=agpl.Server(dflags,func(ctx context.Context,options*agplcoderd.Options) (*agplcoderd.API,error) {
19-
options.DeploymentFlags=&dflags
20-
o:=&coderd.Options{
21-
AuditLogging:dflags.AuditLogging.Value,
22-
BrowserOnly:dflags.BrowserOnly.Value,
23-
SCIMAPIKey: []byte(dflags.SCIMAuthHeader.Value),
24-
UserWorkspaceQuota:dflags.UserWorkspaceQuota.Value,
17+
var (
18+
auditLoggingbool
19+
browserOnlybool
20+
scimAuthHeaderstring
21+
userWorkspaceQuotaint
22+
)
23+
cmd:=agpl.Server(func(ctx context.Context,options*agplcoderd.Options) (*agplcoderd.API,error) {
24+
api,err:=coderd.New(ctx,&coderd.Options{
25+
AuditLogging:auditLogging,
26+
BrowserOnly:browserOnly,
27+
SCIMAPIKey: []byte(scimAuthHeader),
28+
UserWorkspaceQuota:userWorkspaceQuota,
2529
Options:options,
26-
}
27-
api,err:=coderd.New(ctx,o)
30+
})
2831
iferr!=nil {
2932
returnnil,err
3033
}
3134
returnapi.AGPL,nil
3235
})
33-
34-
// append enterprise description to flags
35-
enterpriseOnly:=cliui.Styles.Keyword.Render(" This is an Enterprise feature. Contact sales@coder.com for licensing")
36-
dflags.AuditLogging.Description+=enterpriseOnly
37-
dflags.BrowserOnly.Description+=enterpriseOnly
38-
dflags.SCIMAuthHeader.Description+=enterpriseOnly
39-
dflags.UserWorkspaceQuota.Description+=enterpriseOnly
40-
41-
deployment.BoolFlag(cmd.Flags(),&dflags.AuditLogging)
42-
deployment.BoolFlag(cmd.Flags(),&dflags.BrowserOnly)
43-
deployment.StringFlag(cmd.Flags(),&dflags.SCIMAuthHeader)
44-
deployment.IntFlag(cmd.Flags(),&dflags.UserWorkspaceQuota)
36+
enterpriseOnly:=cliui.Styles.Keyword.Render("This is an Enterprise feature. Contact sales@coder.com for licensing")
37+
38+
cliflag.BoolVarP(cmd.Flags(),&auditLogging,"audit-logging","","CODER_AUDIT_LOGGING",true,
39+
"Specifies whether audit logging is enabled. "+enterpriseOnly)
40+
cliflag.BoolVarP(cmd.Flags(),&browserOnly,"browser-only","","CODER_BROWSER_ONLY",false,
41+
"Whether Coder only allows connections to workspaces via the browser. "+enterpriseOnly)
42+
cliflag.StringVarP(cmd.Flags(),&scimAuthHeader,"scim-auth-header","","CODER_SCIM_API_KEY","",
43+
"Enables SCIM and sets the authentication header for the built-in SCIM server. New users are automatically created with OIDC authentication. "+enterpriseOnly)
44+
cliflag.IntVarP(cmd.Flags(),&userWorkspaceQuota,"user-workspace-quota","","CODER_USER_WORKSPACE_QUOTA",0,
45+
"A positive number applies a limit on how many workspaces each user can create. "+enterpriseOnly)
4546

4647
returncmd
4748
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp