Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Default Timeout of 1h for Pipeline and Task start #901

Merged
merged 1 commit into from
Apr 16, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/cmd/tkn_pipeline_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ my-secret and my-empty-dir)
-s, --serviceaccount string pass the serviceaccount name
--showlog show logs right after starting the pipeline
--task-serviceaccount strings pass the service account corresponding to the task
--timeout string timeout for pipelinerun (default "1h")
--timeout string timeout for pipelinerun
--use-param-defaults use default parameter values without prompting for input
--use-pipelinerun string use this pipelinerun values to re-run the pipeline.
-w, --workspace stringArray pass the workspace.
Expand Down
2 changes: 1 addition & 1 deletion docs/cmd/tkn_task_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ like cat,foo,bar
--prefix-name string specify a prefix for the taskrun name (must be lowercase alphanumeric characters)
-s, --serviceaccount string pass the serviceaccount name
--showlog show logs right after starting the task
--timeout string timeout for taskrun (default "1h")
--timeout string timeout for taskrun
--use-taskrun string specify a taskrun name to use its values to re-run the taskrun
-w, --workspace stringArray pass the workspace.
```
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/tkn-pipeline-start.1
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ Parameters, at least those that have no default value
pass the service account corresponding to the task

.PP
\fB\-\-timeout\fP="1h"
\fB\-\-timeout\fP=""
timeout for pipelinerun

.PP
Expand Down
2 changes: 1 addition & 1 deletion docs/man/man1/tkn-task-start.1
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ Start tasks
show logs right after starting the task

.PP
\fB\-\-timeout\fP="1h"
\fB\-\-timeout\fP=""
timeout for taskrun

.PP
Expand Down
12 changes: 7 additions & 5 deletions pkg/cmd/pipeline/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ like cat,foo,bar
c.Flags().BoolVarP(&opt.DryRun, "dry-run", "", false, "preview pipelinerun without running it")
c.Flags().StringVarP(&opt.Output, "output", "", "", "format of pipelinerun dry-run (yaml or json)")
c.Flags().StringVarP(&opt.PrefixName, "prefix-name", "", "", "specify a prefix for the pipelinerun name (must be lowercase alphanumeric characters)")
c.Flags().StringVarP(&opt.TimeOut, "timeout", "", "1h", "timeout for pipelinerun")
c.Flags().StringVarP(&opt.TimeOut, "timeout", "", "", "timeout for pipelinerun")
c.Flags().StringVarP(&opt.Filename, "filename", "f", "", "local or remote file name containing a pipeline definition to start a pipelinerun")
c.Flags().BoolVarP(&opt.UseParamDefaults, "use-param-defaults", "", false, "use default parameter values without prompting for input")

Expand Down Expand Up @@ -227,11 +227,13 @@ func (opt *startOptions) startPipeline(pipelineStart *v1alpha1.Pipeline) error {
}
}

timeoutDuration, err := time.ParseDuration(opt.TimeOut)
if err != nil {
return err
if opt.TimeOut != "" {
timeoutDuration, err := time.ParseDuration(opt.TimeOut)
if err != nil {
return err
}
pr.Spec.Timeout = &metav1.Duration{Duration: timeoutDuration}
}
pr.Spec.Timeout = &metav1.Duration{Duration: timeoutDuration}

if opt.Last || opt.UsePipelineRun != "" {
var usepr *v1alpha1.PipelineRun
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ spec:
- name: web-image
resourceRef:
name: imageres
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -50,5 +50,4 @@ spec:
- name: web-image
resourceRef:
name: imageres
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ spec:
resourceRef:
name: scaffold-git
serviceAccountName: svc1
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,4 @@ spec:
resourceRef:
name: scaffold-git
serviceAccountName: svc1
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ spec:
resourceRef:
name: scaffold-git
serviceAccountName: svc1
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,4 @@ spec:
resourceRef:
name: scaffold-git
serviceAccountName: svc1
timeout: 1h0m0s
status: {}
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,7 @@
"value": "value1"
}
],
"serviceAccountName": "svc1",
"timeout": "1h0m0s"
"serviceAccountName": "svc1"
},
"status": {}
}
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,7 @@
"name": "imageres"
}
}
],
"timeout": "1h0m0s"
]
},
"status": {}
}
12 changes: 7 additions & 5 deletions pkg/cmd/task/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ like cat,foo,bar
c.Flags().StringArrayVarP(&opt.Workspaces, "workspace", "w", []string{}, "pass the workspace.")
c.Flags().BoolVarP(&opt.ShowLog, "showlog", "", false, "show logs right after starting the task")
c.Flags().StringVarP(&opt.Filename, "filename", "f", "", "local or remote file name containing a task definition to start a taskrun")
c.Flags().StringVarP(&opt.TimeOut, "timeout", "", "1h", "timeout for taskrun")
c.Flags().StringVarP(&opt.TimeOut, "timeout", "", "", "timeout for taskrun")
c.Flags().BoolVarP(&opt.DryRun, "dry-run", "", false, "preview taskrun without running it")
c.Flags().StringVarP(&opt.Output, "output", "", "", "format of taskrun dry-run (yaml or json)")
c.Flags().StringVarP(&opt.PrefixName, "prefix-name", "", "", "specify a prefix for the taskrun name (must be lowercase alphanumeric characters)")
Expand Down Expand Up @@ -260,11 +260,13 @@ func startTask(opt startOptions, args []string) error {
}
}

timeoutDuration, err := time.ParseDuration(opt.TimeOut)
if err != nil {
return err
if opt.TimeOut != "" {
timeoutDuration, err := time.ParseDuration(opt.TimeOut)
if err != nil {
return err
}
tr.Spec.Timeout = &metav1.Duration{Duration: timeoutDuration}
}
tr.Spec.Timeout = &metav1.Duration{Duration: timeoutDuration}

if opt.PrefixName == "" {
tr.ObjectMeta.GenerateName = tname + "-run-"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,5 @@ spec:
image: gcr.io/kaniko-project/executor:v0.14.0
name: build-and-push
resources: {}
timeout: 1h0m0s
status:
podName: ""
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,5 @@ spec:
image: gcr.io/kaniko-project/executor:v0.14.0
name: build-and-push
resources: {}
timeout: 1h0m0s
status:
podName: ""
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ spec:
serviceAccountName: svc1
taskRef:
name: task-1
timeout: 1h0m0s
status:
podName: ""
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,5 @@ spec:
serviceAccountName: svc1
taskRef:
name: task-1
timeout: 1h0m0s
status:
podName: ""
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
"taskRef": {
"name": "task-1"
},
"timeout": "1h0m0s",
"inputs": {
"resources": [
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,6 @@
]
}
},
"timeout": "1h0m0s",
"inputs": {
"resources": [
{
Expand Down