-
Notifications
You must be signed in to change notification settings - Fork 137
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
Added the validation of template while creating it #280
Added the validation of template while creating it #280
Conversation
Codecov Report
@@ Coverage Diff @@
## master #280 +/- ##
==========================================
- Coverage 22.90% 22.65% -0.25%
==========================================
Files 15 15
Lines 1275 1271 -4
==========================================
- Hits 292 288 -4
Misses 964 964
Partials 19 19
Continue to review full report at Codecov.
|
That's nice. A couple of questions:
|
@parauliya I remember you mentioned about having a default value for @gianarb IMO it would be good to have a default, but we still want to make them aware of the new default. Because it is possible that the new default introduces some unexpected behavior. Now, the question is what is the ideal (kinda) default timeout? |
You are right @gauravgahlot . Does not matter the decision we take, it is a bc break. I pinged @thebsdbox to figure out what we want because I don't really have a preference. Probably a default timeout applies here, but I am not strong about it |
@gianarb @gauravgahlot IMO, Since this is a
Due to the above points I think it is better to make this field mandatory and user should provide this as a part of template. If we talk about workflow timeout which is global timeout, this can have a default value which will be calculated dynamically by adding the timeout for all the actions and few additional seconds for communication over the network. |
Like @gianarb I don't have a preference as well. The point is what's more important here is to look for an efficient answer for How do we convey a bc break (like this one) to our existing users? |
I linked a proposal about that |
bfbd317
to
ea4bfd5
Compare
@mmlb told me that internally Packet does not have a concept of per action timeout, but only a global one. And now I have big questions about life. I think I would like to hold this PR until I can clearly figure out if it is needed, or if we should just forget about per action timeout :) |
@mmlb is right that Packet only has a global timeout. Making per-action timeouts mandatory seems overly burdensome for the end user. IMHO, we need a global timeout for the workflow, an optional default timeout that applies to all actions, and (if we're feeling like it's necessary) per-action timeouts that can override the default timeout. I don't think that per-action timeouts should be mandatory. |
@nathangoulding Now the question is what should be the |
ea362cc
to
e5f413a
Compare
I had a chat with @thebsdbox and @nathangoulding to build some context around this feature. Packet does not currently have a per-action timeout and it does not really need it, not sure why Tinkerbell has this feature BUT let's implement it in this way. No validation required, by default the pre-action timeout is set to 0 and it means |
Sure, I am on it. |
b962146
to
69b045a
Compare
9a57ca2
to
24f9473
Compare
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'd like to see the commit split into at least 2 commits, but not enough to actually block the PR on it.
e650652
to
72019c7
Compare
1. If action timeout is not provided in template, tink-worker should wait for that action to complete as long as it takes 2. Added few test cases around template validation Signed-off-by: parauliya <[email protected]>
72019c7
to
8e106cc
Compare
@gianarb @mmlb @detiber @gauravgahlot, Now the code cove report seems good. |
Description
This PR will validate a template. If
timeout
field for an action is not provided or provided with 0 value, then that will be considered as infinite timeout for that particular action.Why is this needed
This fix is required so that Provisioner should only depends on global timeout.
How Has This Been Tested?
Added UT for the
CreateTemplate
API.Also tested through e2e test to ensure that any existing feature doesn't break.
How are existing users impacted? What migration steps/scripts do we need?
No Impact on existig user
Checklist:
I have: