Open gnuoy opened 2 months ago
Similar issue as issue #75 . Due to the omitempty directive when trying to unset min_hwe_kernel the option is dropped if the value is an empty string.
omitempty
min_hwe_kernel
This fails:
_, err = client.Machine.Update(systemID, &entity.MachineParams{ MinHWEKernel: "", }, map[string]interface{}{})
Using the deprecated API client works:
values := make(url.Values) values.Add("min_hwe_kernel", "") machine := new(entity.Machine) machineAPI := apiclient.GetSubObject("machines").GetSubObject(systemID) err := machineAPI.Put(values, func(data []byte) error { return json.Unmarshal(data, machine) }) return err
Hi @gnuoy Thank you for another bug report and for providing a temporary workaround.
I will try to go through it during next week.
Similar issue as issue #75 . Due to the
omitempty
directive when trying to unsetmin_hwe_kernel
the option is dropped if the value is an empty string.This fails:
Using the deprecated API client works: