-
Notifications
You must be signed in to change notification settings - Fork 2k
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
better error handling around Scaling->Max #8360
Conversation
…messages * made api.Scaling.Max a pointer, so we can detect (and complain) when it is neglected * added checks to HCL parsing that it is present * when Scaling.Max is absent/invalid, don't return extraneous error messages during validation * tweak to multiregion handling to ensure that the count is valid on the interpolated regional jobs resolves #8355
@@ -1345,7 +1345,7 @@ func TestParse(t *testing.T) { | |||
Name: helper.StringToPtr("group"), | |||
Scaling: &api.ScalingPolicy{ | |||
Min: nil, | |||
Max: 0, | |||
Max: helper.Int64ToPtr(10), |
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.
Intentionally changed from 0 to 10?
- `count` `(int)` - Specifies the number of instances that should be running | ||
under for this group. This value must be non-negative. This defaults to the | ||
`min` value specified in the [`scaling`](/docs/job-specification/scaling) | ||
block, if present; otherwise, this defaults to `1`. |
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.
Should max
be documented?
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.
lol. yes. thanks 😄
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.
uh, actually, i'll leave it alone. i was just trying to update the default here, not the mechanics of count
LGTM |
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
we don't do validation on the
api
objects, just on the structs objects on the other side of the RPC call. therefore, as a hack that i'm not entirely happy with, whenapi.ScalingPolicy.Max
is missing, i set an invalid value forstructs.ScalingPolicy.Max
(I don't want this to be a pointer), and then respond during validation with a catch-all error message.also updated website to document
Group->Count
default value@tgross , does https://github.com/hashicorp/nomad/pull/8360/files#diff-396d9428285e4245041a3d0b15546d5dR5963 look okay? i did a local multiregion test and everything behaved.
resolves #8355