mirror of https://github.com/rancher/ui.git
Merge pull request #2264 from loganhz/count
Show warning if etcd count is invalid when editing cluster
This commit is contained in:
commit
e4e7c84a25
|
|
@ -149,7 +149,7 @@ export default Component.extend({
|
|||
|
||||
const errors = [];
|
||||
|
||||
if ( !get(this, 'etcdOk') ) {
|
||||
if ( get(this, 'mode') === 'new' && !get(this, 'etcdOk') ) {
|
||||
errors.push(intl.t('clusterNew.rke.errors.etcd'));
|
||||
}
|
||||
|
||||
|
|
@ -201,6 +201,10 @@ export default Component.extend({
|
|||
return count === 1 || count === 3 || count === 5
|
||||
}),
|
||||
|
||||
etcdCount: computed('nodePools.@each.{quantity,etcd}', function() {
|
||||
return this._nodeCountFor('etcd');
|
||||
}),
|
||||
|
||||
controlPlaneOk: computed('nodePools.@each.{quantity,controlPlane}', function() {
|
||||
let count = this._nodeCountFor('controlPlane');
|
||||
|
||||
|
|
|
|||
|
|
@ -97,12 +97,11 @@
|
|||
</div>
|
||||
|
||||
{{#if showIamWarning}}
|
||||
<div class="banner bg-warning">
|
||||
<div class="banner-icon"><span class="icon icon-alert"></span></div>
|
||||
<div class="banner-message">
|
||||
<p>{{t 'clusterNew.rke.warning.aws.iam'}}</p>
|
||||
</div>
|
||||
</div>
|
||||
{{banner-message icon='icon-alert' color='bg-warning mb-10' message=(t 'clusterNew.rke.warning.aws.iam')}}
|
||||
{{/if}}
|
||||
|
||||
{{#if (and (eq mode 'edit') (not etcdOk))}}
|
||||
{{banner-message icon='icon-alert' color='bg-warning mb-10' message=(if (lt etcdCount 1) (t 'clusterNew.rke.warning.etcd.noEtcd') (t 'clusterNew.rke.warning.etcd.even' count=etcdCount))}}
|
||||
{{/if}}
|
||||
{{/accordion-list-item}}
|
||||
{{/accordion-list}}
|
||||
|
|
|
|||
|
|
@ -2157,6 +2157,9 @@ clusterNew:
|
|||
domain: Cluster Domain
|
||||
dns: Cluster DNS Server
|
||||
warning:
|
||||
etcd:
|
||||
even: Setting {count} etcd nodes is a waste of hardware because it doesn't increase the quorum until you have an odd number.
|
||||
noEtcd: The number of etcd nodes should not be less than 1.
|
||||
aws:
|
||||
iam: 'An IAM role name should be provided in node template when using the Cloud Provider Amazon'
|
||||
errors:
|
||||
|
|
|
|||
Loading…
Reference in New Issue