terraform-provider-nutanix icon indicating copy to clipboard operation
terraform-provider-nutanix copied to clipboard

validation for compatible Nutanix API version

Open kruftik opened this issue 4 years ago • 2 comments

Is your feature request related to a problem? Please describe. The provider seems not to validate if the version of remote Nutanix API is compatible one, i.e. whether the required methods exist and they have expected interfaces.

For instance, Karbon API v2.1.1 does not does not have /karbon/v1-alpha.1/k8s/clusters/{name}/node-pools/{node-group-name}/add-nodes and similar methods while v2.2 do. Such a difference results in strange errors during the cluster updates in terms of node pool sizes.

Another annoying example is cni_config section does not exist GET /karbon/v1/k8s/clusters/{name} method response in v2.1.1. The absense of the cni_config key in JSON object due to golang's null values is treated as being filled in with defaults (flannel as CNI provider, default pod and service CIDRs and so on). This causes to "update in-place" the Karbon cluster each time terraform apply is called though the real update does not occur.

Describe the solution you'd like It's necessary to check whether remote API is compatible with the function to be used before any API calls.

kruftik avatar Feb 14 '21 16:02 kruftik

The Karbon resource was developed and based on Karbon version 2.2. We will modify the documentation to reflect this version requirement. @marinsalinas

yannickstruyf3 avatar Feb 15 '21 15:02 yannickstruyf3

Do you not agree it would be a good idea to check if remote API is REALLY v2.2 or some elder stuff? I believe it would be extra useful in terms of UX.

kruftik avatar Feb 15 '21 15:02 kruftik