Closed MrFlynn closed 8 months ago
Hey @MrFlynn. Have you tried creating a machine with your changes in place? if so: did it fix the issue you've highlighted?
If you create a PR with the changes we could get it reviewed.
It's been about a year since I filed this issue, so I might be misremembering, but as I recall I passed the commission value through the powerParams
map in Machines.Create
since that allowed me to set the value properly.
Hi @MrFlynn,
As you can observe in the MAAS codebase here, the default value for commission
is false, if it is not set in the parameters. As a result, it is fine to exclude it with omitempty
if user has not set it, or it is set to false. Thank you for opening the issue in the first place and also coming back to respond. I will close this issue and if you encounter any problem with the latest release of gomaasclient
please let us know. :slightly_smiling_face:
Hello,
While using this library, I encountered an issue caused by this
omitempty
tag. If theCommission
field is set tofalse
, the querystring library will exclude this key-value pair from the resulting query parameters.https://github.com/maas/gomaasclient/blob/14c6f5604abb9429d1a31aea883365656eaee635/entity/machine.go#L110
Creating a machine without automatically commissioning it is a valid action, so removing the
omitempty
would be necessary to make the library compliant with that behavior.