From cdf45cad2d89a6e69ff00234c0622550e54a839f Mon Sep 17 00:00:00 2001 From: Cody Jackson Date: Fri, 12 Feb 2021 15:58:01 -0700 Subject: [PATCH] Provide more context around in-tree and out-of-tree cloud providers - Add helper text to help people find the out-of-tree providers for vsphere - Label each in-tree provider with (In-tree) label - Show a deprecated message for each in-tree option rancher/rancher#31162 --- .../cru-cloud-provider/component.js | 14 +++++++++++ .../cru-cloud-provider/template.hbs | 23 ++++++++++++++++--- translations/en-us.yaml | 10 +++++--- 3 files changed, 41 insertions(+), 6 deletions(-) diff --git a/lib/shared/addon/components/cru-cloud-provider/component.js b/lib/shared/addon/components/cru-cloud-provider/component.js index 6d561412c..52e3ad83a 100644 --- a/lib/shared/addon/components/cru-cloud-provider/component.js +++ b/lib/shared/addon/components/cru-cloud-provider/component.js @@ -178,6 +178,20 @@ export default Component.extend({ return out; }), + showVsphereHelperText: computed('selectedCloudProvider', 'driver', function() { + const driver = get(this, 'driver'); + const selectedCloudProvider = get(this, 'selectedCloudProvider'); + + return (driver === 'custom' || driver === 'vmwarevsphere') && + (selectedCloudProvider === 'external') + }), + + isInTree: computed('selectedCloudProvider', function() { + const selectedCloudProvider = get(this, 'selectedCloudProvider'); + + return selectedCloudProvider !== 'external' && selectedCloudProvider !== 'none'; + }), + checkDefaults(record) { get(this, 'azureDefaults').forEach((def) => { if (isEmpty(record[def])) { diff --git a/lib/shared/addon/components/cru-cloud-provider/template.hbs b/lib/shared/addon/components/cru-cloud-provider/template.hbs index 25c0f302c..6067258e2 100644 --- a/lib/shared/addon/components/cru-cloud-provider/template.hbs +++ b/lib/shared/addon/components/cru-cloud-provider/template.hbs @@ -100,7 +100,7 @@ {{#if (and applyClusterTemplate (eq selectedCloudProvider "generic"))}}
{{else if isCreateClusterOrClusterTemplate}} @@ -109,7 +109,7 @@ {{radio-button selection=selectedCloudProvider value="generic" - }} {{t "generic.custom"}} + }} {{t "cloudProvider.custom.label"}} {{/if}} @@ -136,6 +136,13 @@ {{#if (and (not-eq selectedCloudProvider "none") (eq mode "new"))}}
+ {{#if isInTree}} + + {{/if}} {{#if (eq selectedCloudProvider "generic")}} {{t "cloudProvider.custom.helpText" htmlSafe=true}} - {{else if (eq selectedCloudProvider "external")}} + {{else if (and (eq selectedCloudProvider "external") (not (eq driver "vmwarevsphere")) )}} {{t "cloudProvider.external.helpText" htmlSafe=true}} {{/if}}

+ {{#if showVsphereHelperText}} +

+ {{t + "cloudProvider.external.vsphereHelpText" + csi=(href-to 'global-admin.multi-cluster-apps.catalog.launch' 'cattle-global-data:helm3-library-vsphere-csi') + cpi=(href-to 'global-admin.multi-cluster-apps.catalog.launch' 'cattle-global-data:helm3-library-vsphere-cpi') + htmlSafe=true + }} +

+ {{/if}} {{/if}} \ No newline at end of file diff --git a/translations/en-us.yaml b/translations/en-us.yaml index 6932f5060..d5015a601 100644 --- a/translations/en-us.yaml +++ b/translations/en-us.yaml @@ -3152,14 +3152,16 @@ billingInfo: actions: Actions cloudProvider: - title: In-Tree Cloud Provider - amazon: Amazon - azure: Azure + title: Cloud Provider + amazon: Amazon (In-Tree) + azure: Azure (In-Tree) external: label: External helpText: 'Please edit the YAML to specify the required addon for cloud controller manager.' + vsphereHelpText: 'Out-of-tree cloud provider for vsphere is available through the vsphere-csi and vsphere-cpi helm charts.' name: Cloud Provider Name custom: + label: Custom (In-Tree) notInList: 'If your cloud provider is not listed, please use the Custom option.' helpText: 'Please edit the YAML to add in any other cloud providers' @@ -3167,6 +3169,8 @@ cloudProvider: Read more about the state of the Kubernetes in-tree cloud providers warning: Configuring a Cloud Provider in your cluster without configuring the prerequisites will cause your cluster to not provision correctly. Prerequisites needed for supported cloud providers can be found in the documentation. + inTreeDeprecated: + In-tree cloud providers are deprecated azureCloudConfig: cloudProviderBackoff: description: "Enable exponential backoff to manage resource request retries"