embercsi / ember-csi-operator

Operator to create/configure/manage Ember CSI Driver atop Kubernetes/OpenShift
Apache License 2.0
3 stars 6 forks source link

Operator form incorrectly handling Float values #109

Open Akrog opened 4 years ago

Akrog commented 4 years ago

The current operator form parses float values in driver configuration as text, which means they reach as str to Ember-CSI code, which breaks drivers that use float's in their configuration and assume (reasonably) that they receive them as float and not str.

As an example: Issue #166 in the Ember-CSI repository that fails because of the vmware_task_poll_interval configuration option.

The reason why we were converting to text is the OLM not having a float type. It only has the number type and using it for floats will truncate the number and removes the decimal portion of the number.

A possible solution is to add a new transform function on the operator to the existing ones that transforms from text to a float and then add this new transform to the generator and then use it on the floats configuration options section.

That way Ember-CSI will be able to receive a float instance instead of a string.