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

Commitfb0842f

Browse files
committed
fix merge
1 parentff704ed commitfb0842f

File tree

2 files changed

+0
-104
lines changed

2 files changed

+0
-104
lines changed

‎cli/templatecreate.go‎

Lines changed: 0 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -47,46 +47,7 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
4747
r.InitClient(client),
4848
),
4949
Handler:func(inv*clibase.Invocation)error {
50-
<<<<<<<HEAD
51-
<<<<<<<HEAD
52-
isTemplateSchedulingOptionsSet:=failureTTL!=0||dormancyThreshold!=0||dormancyAutoDeletion!=0||maxTTL!=0
53-
54-
ifisTemplateSchedulingOptionsSet||requireActiveVersion {
55-
iffailureTTL!=0||dormancyThreshold!=0||dormancyAutoDeletion!=0 {
56-
// This call can be removed when workspace_actions is no longer experimental
57-
experiments,exErr:=client.Experiments(inv.Context())
58-
ifexErr!=nil {
59-
returnxerrors.Errorf("get experiments: %w",exErr)
60-
}
61-
62-
if!experiments.Enabled(codersdk.ExperimentWorkspaceActions) {
63-
returnxerrors.Errorf("--failure-ttl, --dormancy-threshold, and --dormancy-auto-deletion are experimental features. Use the workspace_actions CODER_EXPERIMENTS flag to set these configuration values.")
64-
}
65-
}
66-
67-
entitlements,err:=client.Entitlements(inv.Context())
68-
ifcerr,ok:=codersdk.AsError(err);ok&&cerr.StatusCode()==http.StatusNotFound {
69-
returnxerrors.Errorf("your deployment appears to be an AGPL deployment, so you cannot set enterprise-only flags")
70-
}elseiferr!=nil {
71-
returnxerrors.Errorf("get entitlements: %w",err)
72-
}
73-
74-
ifisTemplateSchedulingOptionsSet {
75-
if!entitlements.Features[codersdk.FeatureAdvancedTemplateScheduling].Enabled {
76-
returnxerrors.Errorf("your license is not entitled to use advanced template scheduling, so you cannot set --failure-ttl, --inactivity-ttl, or --max-ttl")
77-
}
78-
}
79-
80-
ifrequireActiveVersion {
81-
if!entitlements.Features[codersdk.FeatureAccessControl].Enabled {
82-
returnxerrors.Errorf("your license is not entitled to use enterprise access control, so you cannot set --require-active-version")
83-
}
84-
}
85-
=======
86-
err:=handleEntitlements(inv.Context(),handleEntitlementsArgs{
87-
=======
8850
err:=createEntitlementsCheck(inv.Context(),handleEntitlementsArgs{
89-
>>>>>>>3c377e5d3 (combineeditflags)
9051
client:client,
9152
requireActiveVersion:requireActiveVersion,
9253
defaultTTL:defaultTTL,
@@ -97,7 +58,6 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
9758
})
9859
iferr!=nil {
9960
returnerr
100-
>>>>>>>7b0afe8e9 (fix:maketemplatepushasupersetoftemplatecreate)
10161
}
10262

10363
organization,err:=CurrentOrganization(inv,client)
@@ -420,15 +380,6 @@ func createEntitlementsCheck(ctx context.Context, args handleEntitlementsArgs) e
420380
if!entitlements.Features[codersdk.FeatureAccessControl].Enabled {
421381
returnxerrors.Errorf("your license is not entitled to use enterprise access control, so you cannot set --require-active-version")
422382
}
423-
424-
experiments,exErr:=args.client.Experiments(ctx)
425-
ifexErr!=nil {
426-
returnxerrors.Errorf("get experiments: %w",exErr)
427-
}
428-
429-
if!experiments.Enabled(codersdk.ExperimentTemplateUpdatePolicies) {
430-
returnxerrors.Errorf("--require-active-version is an experimental feature, contact an administrator to enable the 'template_update_policies' experiment on your Coder server")
431-
}
432383
}
433384
}
434385

‎cli/templateedit.go‎

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -47,52 +47,6 @@ func (r *RootCmd) templateEdit() *clibase.Cmd {
4747
),
4848
Short:"Edit the metadata of a template by name.",
4949
Handler:func(inv*clibase.Invocation)error {
50-
<<<<<<<HEAD
51-
// This clause can be removed when workspace_actions is no longer experimental
52-
iffailureTTL!=0||dormancyThreshold!=0||dormancyAutoDeletion!=0 {
53-
experiments,exErr:=client.Experiments(inv.Context())
54-
ifexErr!=nil {
55-
returnxerrors.Errorf("get experiments: %w",exErr)
56-
}
57-
58-
if!experiments.Enabled(codersdk.ExperimentWorkspaceActions) {
59-
returnxerrors.Errorf("--failure-ttl, --dormancy-threshold, and --dormancy-auto-deletion are experimental features. Use the workspace_actions CODER_EXPERIMENTS flag to set these configuration values.")
60-
}
61-
}
62-
63-
unsetAutostopRequirementDaysOfWeek:=len(autostopRequirementDaysOfWeek)==1&&autostopRequirementDaysOfWeek[0]=="none"
64-
requiresScheduling:= (len(autostopRequirementDaysOfWeek)>0&&!unsetAutostopRequirementDaysOfWeek)||
65-
autostopRequirementWeeks>0||
66-
!allowUserAutostart||
67-
!allowUserAutostop||
68-
maxTTL!=0||
69-
failureTTL!=0||
70-
dormancyThreshold!=0||
71-
dormancyAutoDeletion!=0||
72-
len(autostartRequirementDaysOfWeek)>0
73-
74-
requiresEntitlement:=requiresScheduling||requireActiveVersion
75-
ifrequiresEntitlement {
76-
entitlements,err:=client.Entitlements(inv.Context())
77-
ifcerr,ok:=codersdk.AsError(err);ok&&cerr.StatusCode()==http.StatusNotFound {
78-
returnxerrors.Errorf("your deployment appears to be an AGPL deployment, so you cannot set enterprise-only flags")
79-
}elseiferr!=nil {
80-
returnxerrors.Errorf("get entitlements: %w",err)
81-
}
82-
83-
ifrequiresScheduling&&!entitlements.Features[codersdk.FeatureAdvancedTemplateScheduling].Enabled {
84-
returnxerrors.Errorf("your license is not entitled to use advanced template scheduling, so you cannot set --max-ttl, --failure-ttl, --inactivityTTL, --allow-user-autostart=false or --allow-user-autostop=false")
85-
}
86-
87-
ifrequireActiveVersion {
88-
if!entitlements.Features[codersdk.FeatureAccessControl].Enabled {
89-
returnxerrors.Errorf("your license is not entitled to use enterprise access control, so you cannot set --require-active-version")
90-
}
91-
}
92-
}
93-
94-
=======
95-
>>>>>>>3c377e5d3 (combineeditflags)
9650
organization,err:=CurrentOrganization(inv,client)
9751
iferr!=nil {
9852
returnxerrors.Errorf("get current organization: %w",err)
@@ -341,15 +295,6 @@ func editTemplateEntitlementsCheck(ctx context.Context, args editTemplateEntitle
341295
if!entitlements.Features[codersdk.FeatureAccessControl].Enabled {
342296
returnfalse,xerrors.Errorf("your license is not entitled to use enterprise access control, so you cannot set --require-active-version")
343297
}
344-
345-
experiments,exErr:=args.client.Experiments(ctx)
346-
ifexErr!=nil {
347-
returnfalse,xerrors.Errorf("get experiments: %w",exErr)
348-
}
349-
350-
if!experiments.Enabled(codersdk.ExperimentTemplateUpdatePolicies) {
351-
returnfalse,xerrors.Errorf("--require-active-version is an experimental feature, contact an administrator to enable the 'template_update_policies' experiment on your Coder server")
352-
}
353298
}
354299
}
355300

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp