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

Commitf149db6

Browse files
authored
fix(cli): add --max-ttl to template create (#9319)
It was just in template edit by mistake.
1 parent3b1ecd3 commitf149db6

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed

‎cli/templatecreate.go

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,11 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
2929
variablesFilestring
3030
variables []string
3131
disableEveryonebool
32-
defaultTTL time.Duration
33-
failureTTL time.Duration
34-
inactivityTTL time.Duration
32+
33+
defaultTTL time.Duration
34+
failureTTL time.Duration
35+
inactivityTTL time.Duration
36+
maxTTL time.Duration
3537

3638
uploadFlagstemplateUploadFlags
3739
)
@@ -44,7 +46,7 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
4446
r.InitClient(client),
4547
),
4648
Handler:func(inv*clibase.Invocation)error {
47-
iffailureTTL!=0||inactivityTTL!=0 {
49+
iffailureTTL!=0||inactivityTTL!=0||maxTTL!=0{
4850
// This call can be removed when workspace_actions is no longer experimental
4951
experiments,exErr:=client.Experiments(inv.Context())
5052
ifexErr!=nil {
@@ -134,6 +136,7 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
134136
VersionID:job.ID,
135137
DefaultTTLMillis:ptr.Ref(defaultTTL.Milliseconds()),
136138
FailureTTLMillis:ptr.Ref(failureTTL.Milliseconds()),
139+
MaxTTLMillis:ptr.Ref(maxTTL.Milliseconds()),
137140
TimeTilDormantMillis:ptr.Ref(inactivityTTL.Milliseconds()),
138141
DisableEveryoneGroupAccess:disableEveryone,
139142
}
@@ -198,6 +201,11 @@ func (r *RootCmd) templateCreate() *clibase.Cmd {
198201
Default:"0h",
199202
Value:clibase.DurationOf(&inactivityTTL),
200203
},
204+
{
205+
Flag:"max-ttl",
206+
Description:"Edit the template maximum time before shutdown - workspaces created from this template must shutdown within the given duration after starting. This is an enterprise-only feature.",
207+
Value:clibase.DurationOf(&maxTTL),
208+
},
201209
{
202210
Flag:"test.provisioner",
203211
Description:"Customize the provisioner backend.",

‎cli/testdata/coder_templates_create_--help.golden

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ Create a template from the current directory or as specified by flag
2121
Specify an inactivity TTL for workspaces created from this template.
2222
This licensed feature's default is 0h (off).
2323

24+
--max-ttl duration
25+
Edit the template maximum time before shutdown - workspaces created
26+
from this template must shutdown within the given duration after
27+
starting. This is an enterprise-only feature.
28+
2429
-m, --message string
2530
Specify a message describing the changes in this version of the
2631
template. Messages longer than 72 characters will be displayed as

‎docs/cli/templates_create.md

Lines changed: 8 additions & 0 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp