You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: submit.go
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@ import (
16
16
17
17
"github.com/Pallinder/go-randomdata"
18
18
"github.com/alexflint/go-arg"
19
+
"github.com/peterhellberg/duration"
19
20
"github.com/ovh/go-ovh/ovh"
20
21
"gopkg.in/ini.v1"
21
22
)
@@ -42,6 +43,7 @@ var (
42
43
Packagesstring`arg:"--packages" help:"Comma-delimited list of Maven coordinates"`
43
44
Repositoriesstring`arg:"--repositories" help:"Comma-delimited list of additional repositories (or resolvers in SBT)"`
44
45
PropertiesFilestring`arg:"--properties-file" help:"Read properties from the given file"`
46
+
Ttlstring`arg:"--ttl" help:"Maximum \"Time To Live\" (in RFC3339 (duration) eg. "P1DT30H4S") of this job, after which it will be automatically terminated"`
45
47
Filestring`arg:"positional,required"`
46
48
Parameters []string`arg:"positional"`
47
49
}
@@ -157,6 +159,7 @@ func ParsArgs() *JobSubmit {
157
159
Region: args.Region,
158
160
EngineVersion: args.SparkVersion,
159
161
EngineParameters: []*JobEngineParameter{},
162
+
Ttl: args.Ttl,
160
163
}
161
164
162
165
ifargs.JobName=="" {
@@ -255,6 +258,13 @@ func ParsArgs() *JobSubmit {
255
258
})
256
259
}
257
260
261
+
ifargs.Ttl!="" {
262
+
_, err:=duration.Parse(args.Ttl);
263
+
iferr!=nil {
264
+
p.Fail("Invalid value for --ttl. It must be in RFC3339 (duration) format (i.e. PT30H for 30 hours)")
0 commit comments