Skip to content
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

Merged
merged 3 commits into from
Feb 20, 2018
Merged

Manage quota specifications. #25

merged 3 commits into from
Feb 20, 2018

Conversation

paddycarver
Copy link
Contributor

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? 🤷

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
Copy link
Contributor

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") {
Copy link
Contributor

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@paddycarver paddycarver dismissed paultyng’s stale review February 20, 2018 10:41

Made requested changes.

Copy link
Contributor

@paultyng paultyng left a 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.

@paddycarver paddycarver merged commit 8aafa58 into master Feb 20, 2018
@cgbaker cgbaker deleted the paddy_quota branch March 1, 2019 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants