-
Notifications
You must be signed in to change notification settings - Fork 101
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
Manage quota specifications. #25
Conversation
Add a resource to manage quota specifications, limiting the resources that can be used in a region. The tests for this are 🙀 because sets nested in sets, but... they gave me confidence that it works? 🤷
} | ||
spec.Limits = limits | ||
|
||
// upsert our quota spec |
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.
Since this is an upsert like the update, could you just called the update here and then SetId
? Or add some shared inner func? They appear to be the same code except for some messaging and the SetId
.
if err != nil { | ||
// As of Nomad 0.4.1, the API client returns an error for 404 | ||
// rather than a nil result, so we must check this way. | ||
if strings.Contains(err.Error(), "404") { |
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.
This is super ugly 😢 is there an issue open on the Nomad API to at least return a named/typed err?
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.
There is! hashicorp/nomad#1849
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, only additional suggestion is maybe comment with that Nomad issue # in the source.
Add a resource to manage quota specifications, limiting the resources
that can be used in a region.
The tests for this are 🙀 because sets nested in sets, but... they gave
me confidence that it works? 🤷