rancher / capi-ui-extension

Rancher Extension used in rancher/dashboard for Rancher Turtles CAPI Provisioning UI.
Apache License 2.0
8 stars 7 forks source link

Error when enabling a custom provider without a version #60

Open richardcase opened 1 month ago

richardcase commented 1 month ago

When enabling a custom provider and not specifying a version the request silently fails.

To repro:

Looking at the request/response you see it sends:

{
    "type": "turtles-capi.cattle.io.capiprovider",
    "metadata": {
        "namespace": "default",
        "name": "kubeadm-controlplane"
    },
    "spec": {
        "name": "kubeadm",
        "type": "controlPlane",
        "configSecret": {
            "name": "custom-credentials-zwa8c"
        },
        "credentials": null,
        "fetchConfig": {
            "url": ""
        },
        "version": "",
        "features": {
            "clusterResourceSet": true,
            "clusterTopology": true,
            "machinePool": true
        },
        "variables": {}
    }
}

And this responds with an error:

{
    "type": "error",
    "links": {},
    "code": "Invalid",
    "message": "CAPIProvider.turtles-capi.cattle.io \"kubeadm-controlplane\" is invalid: spec: Invalid value: \"object\": CAPI Provider version should be in the semver format prefixed with 'v'. Example: v1.9.3",
    "status": 422,
    "type": "error"
}

It feels like there are 2 issues here:

cpinjani commented 1 month ago

Also, version field should allow custom such as v1.3.3-cabpr-fix image