Uncaught Error: intl string context variable 'docsBase' when creating a cluster after switching the cloud provider to `external`
Setup
- Rancher version: 2.8.1
- Rancher UI Extensions: 2.8.1
- Browser type & version: firefox v121
Describe the bug
when provisioning an rke1 custom cluster, switching from view as form -> view as yaml and back again broke the k8s version dropdown. Further inspection revealed the following error
Uncaught Error: The intl string context variable 'docsBase' was not provided to the string 'Out-of-tree cloud provider for vsphere is available through the vsphere-csi and vsphere-cpi helm charts. Please refer to the <a href="{docsBase}/cluster-provisioning/rke-clusters/cloud-providers/vsphere/out-of-tree" target="_blank" rel="nofollow noopener noreferrer">docs</a> for installation.'
To Reproduce
- in rancher, start provisioning a custom rke1 cluster
- switch the cloud provider option to
external - click the
view as yamlbutton - click the
view as formbutton - maybe do this 2x in a row
Result
- observe the
network providerandkubernetes versiondropdowns fail to populate - also seeing the error
invalid semver version <=1.27.x
Expected Result
user should be able to switch between views freely
Screenshots
Additional context
not yet tested on 2.9 nor 2.7
Hello,
I encounter the same issue. I tried on a Rancher just upgraded from v2.7.9 and on a fresh install of Rancher v2.8.1. This happens also when I edit a cluster (RKE1) which has cloud provider configured to "out of tree": Kubernetes version drop down is not populated.
The fix is trivial - in lib/shared/addon/components/cluster-driver/driver-rke/component.js, change:
{{t "cloudProvider.external.vsphereHelpText" htmlSafe=true}}
to
{{t "cloudProvider.external.vsphereHelpText" docsBase=settings.docsBase htmlSafe=true}}
Linking SURE-7627
Looks like this affects the edit page of all rke1 clusters with (a custom or wmware driver) and (external cloud provider).
https://github.com/rancher/ui/blob/8efc7f23a7a516afaca2dbefe40ae914e92b73b1/lib/shared/addon/components/cru-cloud-provider/component.js#L210
I've reproduced error by creating a custom RKE1 cluster with an external code provider and then going to edit said cluster.
/backport v2.8.next1
PR https://github.com/rancher/ui/pull/5127 merged so this can be tested, though QA already did test this in 2.8.next1 so I'll defer to them if this needs retesting or automation.
Tests pass on v2.9-e2023b437f3ccba16169b1e51db18419832ca5d7-head