Change tkn task start --timeout Flag to a String to Allow User to Pass Duration Instead of Seconds #730
Labels
kind/feature
Categorizes issue or PR as related to a new feature.
Milestone
Currently, the
--timeout
flag fortkn task start
is an int64 to allow a user to specify in seconds what a timeout should be for a TaskRun. As described in this comment, it would be a much better user experience to allow users to pass a string in duration format (e.g.1h30m2s
) instead of the exact number of seconds for a timeout. This will allow for timeouts to be specified in much clearer, more granular way.The conversion process would consist of changing the TimeOut option to a string, updating the associated timeout flag, parsing the duration string passed by the user using
time.parseDuration(opt.TimeOut)
, and passing the parsed duration to the TaskRunSpec Timeout field.Since this will alter existing behavior, this should not be implemented until
v0.9.0
so we can give users a warning. The warning should consist of calling this change out in thev0.8.0
release notes and also adding a log warning inv0.8.0
that this behavior will change. The log warning will be implemented in a similar way to what is being done in #729.The text was updated successfully, but these errors were encountered: