You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<tl;dr> If omitempty is used with a boolean option then go-querystring drops it if it is set to false.
Which leads to: "commissioning = false" => commissioning option dropped => maas runs commissioning </tl;dr>
When adding a machine manually via the CLI it is possible to skip commissioning by setting
If commission is not explicitly set in a request to the maas api then maas does the default which is to run a commission. Which leads to the following:
Maas will run a commission because when the machine params are processes the commission option is dropped (https://github.com/maas/gomaasclient/blob/master/client/machines.go#L37) because it is set to false and that option has omitempty set. omitempty omits the value if "...values are false, 0, any nil pointer or interface value, any array slice, map, or string of length zero, and any type (such as time.Time) that returns true for IsZero()."
The text was updated successfully, but these errors were encountered:
<tl;dr> If
omitempty
is used with a boolean option thengo-querystring
drops it if it is set tofalse
.Which leads to: "commissioning = false" => commissioning option dropped => maas runs commissioning </tl;dr>
When adding a machine manually via the CLI it is possible to skip commissioning by setting
maas admin machines create ... commission=false
This is not possible via the
gomaasclient
due to the wayMachineParams
are defined ( https://github.com/maas/gomaasclient/blob/master/entity/machine.go#L223 ) .If
commission
is not explicitly set in a request to the maas api then maas does the default which is to run a commission. Which leads to the following:If commission is unset:
Maas will run a commission as this is the default behaviour
If commission is set to True:
Maas will run a commission as explicitly requested
If commission is set to False:
Maas will run a commission because when the machine params are processes the commission option is dropped (https://github.com/maas/gomaasclient/blob/master/client/machines.go#L37) because it is set to
false
and that option hasomitempty
set.omitempty
omits the value if "...values are false, 0, any nil pointer or interface value, any array slice, map, or string of length zero, and any type (such as time.Time) that returns true for IsZero()."The text was updated successfully, but these errors were encountered: