-
Notifications
You must be signed in to change notification settings - Fork 1
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
addition of signadot job submit -f ... --wait
#152
Conversation
scott-cotton
commented
Dec 30, 2024
•
edited
Loading
edited
checkpoint
Just to get a little bit of context, the main difference is that wait don't print the logs? Or there is other difference? |
The main objective of this is to make it simple to run a job and determine in CI (automatically) whether it succeeded. |
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.
Overall seems like a good idea and the fact that it's orthogonal to --attach
makes sense.
internal/config/job.go
Outdated
@@ -26,6 +27,7 @@ func (c *JobSubmit) AddFlags(cmd *cobra.Command) { | |||
cmd.Flags().Var(&c.TemplateVals, "set", "--set var=val") | |||
cmd.Flags().BoolVar(&c.Attach, "attach", false, "waits until the job is completed, displaying the stdout and stderr streams") | |||
cmd.Flags().DurationVar(&c.Timeout, "timeout", 0, "timeout when waiting for the job to be started, if 0 is specified, no timeout will be applied and the command will wait until completion or cancellation of the job (default 0)") |
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.
In sb apply
, we have --wait
and --wait-timeout
. Here, we have this timeout
property that looks sort of related to wait
. I'm curious whether this timeout is the equivalent of --wait-timeout
when using with --wait
?
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.
yes, it is. I guess we could add an alias or something to make it more uniform
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.
I double checked this and
- I corrected the description, which was improperly worded before this PR, now it applies to both --attach and --wait
- I fixed how --timeout applies to --wait; I had tested that but I guess I got the test wrong or it was on a dev version. Now it actually checks the timeout when non-zero during the --wait poll.
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, just left a minor comment.