-
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
Adding new attributes to the quota spec resource #332
base: main
Are you sure you want to change the base?
Conversation
Just a first pass adding the attributes.
@lgfa29 sorry to poke you directly, but question: with changes like this where an API is changing a lot are there concerns about backwards compatibility? It is all new attributes, nothing renamed or removed. So I assume the actual API calls should work. |
Also for reference, here is the go struct for QuotaLimit that the API expects: https://pkg.go.dev/github.com/hashicorp/nomad/api#QuotaLimit |
Yup, adding new attributes should be fine 👍 |
So problem: I am unable to run the tests for the quota specification as that is an enterprise feature, I don't have an enterprise license, and the install script (https://github.com/hashicorp/terraform-provider-nomad/blob/main/scripts/getnomad.sh#L8) does not install an enterprise version unless you have a license. Should I just write the tests and hope they pass? Or is there a work around for this? |
Question: What is the default value of optional integers? Example existing code:
And the docs for that:
What makes the default 0? Is the provider setting it to 0 somewhere, is that because the Go language treats it as 0, or is that because we know that the Nomad API will default it to 0 if the attribute is not set at all? Make this slightly more confusing, some of the documentation will list optional strings differently: From
From
|
Hi @regner, sorry for the delay getting back to you here. I had to focus on Nomad 1.6 so I ended up missing some of the other work streams.
Yeah, that's not great, but I'm not sure if there's another solution available. For some reason CI is also not running tests on this PR (I will also look into this), so for now feel free to write tests and hope they work. I can run them manually before merge.
You got it right here: "because the Go language treats it as 0".
Normally we mark it fields as Now, that's not an exact science and I'm sure there are plenty of inconsistencies 😅 |
Fix for #321. Just a first pass adding the attributes.
Still need to add tests and docs.