-
Notifications
You must be signed in to change notification settings - Fork 250
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
Add --dry-run Option for tkn task start #662
Conversation
@@ -186,6 +194,7 @@ func startTask(opt startOptions, args []string) error { | |||
TaskSpec: &task.Spec, | |||
} | |||
} | |||
tr.Spec.Timeout = &metav1.Duration{Duration: timeoutSeconds} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Moving setting Timeout
here so that -f
can set timeout for TaskRun.
@@ -153,7 +153,7 @@ like cat,foo,bar | |||
c.Flags().BoolVarP(&opt.Last, "last", "L", false, "re-run the pipeline using last pipelinerun values") | |||
c.Flags().StringSliceVarP(&opt.Labels, "labels", "l", []string{}, "pass labels as label=value.") | |||
c.Flags().BoolVarP(&opt.DryRun, "dry-run", "", false, "preview pipelinerun without running it") | |||
c.Flags().StringVarP(&opt.Output, "output", "o", "", "format of pipelinerun dry-run (yaml or json)") | |||
c.Flags().StringVarP(&opt.Output, "output", "", "", "format of pipelinerun dry-run (yaml or json)") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removing to keep consistency across --dry-run
commands.
@@ -898,3 +900,130 @@ func Test_parseRes(t *testing.T) { | |||
}) | |||
} | |||
} | |||
|
|||
func TestTaskStart_ExecuteCommand(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should eventually move as many tests in this block as can be moved.
/lgtm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/lgtm Thanks 👍🏼🔥 |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: chmouel, pradeepitm12 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Closes #654
Similar to #643, this pull request adds the ability to do a dry run of a taskrun with
tkn task start
. A notable issue with this, is that steps won't be included with this approach since it mainly relies on aTaskRef
to start tasks, but it does show information on inputs, outputs, and params as well as the task reference being used. Using the-f
option does provide information about steps since it does not require a TaskRef.This pull request also makes a small change for the
--timeout
option, which is currently not available with-f
due to only defining it when a task name argument is provided.The last change in this pr is getting rid of the
-o
shorthand for output with--dry-run
fortkn pipeline start --dry-run
.-o
is not available withtkn task start
because of outputs so I think it makes sense to keep it consistent across all commands. Only specifying--output
works now.Submitter Checklist
make docs
andmake man
if needed.make check
Release Notes