kubernetes-operators icon indicating copy to clipboard operation
kubernetes-operators copied to clipboard

Allow required flavor props to be zero-valued

Open grandchild opened this issue 1 year ago • 1 comments

Trying to seed a flavor with 0 disk size fails because the 0-value get's pruned from the flavor spec.

According to https://pkg.go.dev/encoding/json#Marshal the "omitempty" option in the struct definition is to blame for this. Remove it for some fields that are required for a flavor: RAM, Disk & vCPUs.

While it's hard to conceive of a useful flavor without either RAM or CPUs, it might be required for testing -- just like the testing flavor with no disk size that just failed.

grandchild avatar May 15 '23 13:05 grandchild