Merge pull request #2264 from loganhz/count

Show warning if etcd count is invalid when editing cluster
This commit is contained in:
Westly Wright 2018-09-13 12:03:45 -07:00 committed by GitHub
commit e4e7c84a25
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 7 deletions

View File

@ -149,7 +149,7 @@ export default Component.extend({
const errors = []; const errors = [];
if ( !get(this, 'etcdOk') ) { if ( get(this, 'mode') === 'new' && !get(this, 'etcdOk') ) {
errors.push(intl.t('clusterNew.rke.errors.etcd')); errors.push(intl.t('clusterNew.rke.errors.etcd'));
} }
@ -201,6 +201,10 @@ export default Component.extend({
return count === 1 || count === 3 || count === 5 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() { controlPlaneOk: computed('nodePools.@each.{quantity,controlPlane}', function() {
let count = this._nodeCountFor('controlPlane'); let count = this._nodeCountFor('controlPlane');

View File

@ -97,12 +97,11 @@
</div> </div>
{{#if showIamWarning}} {{#if showIamWarning}}
<div class="banner bg-warning"> {{banner-message icon='icon-alert' color='bg-warning mb-10' message=(t 'clusterNew.rke.warning.aws.iam')}}
<div class="banner-icon"><span class="icon icon-alert"></span></div> {{/if}}
<div class="banner-message">
<p>{{t 'clusterNew.rke.warning.aws.iam'}}</p> {{#if (and (eq mode 'edit') (not etcdOk))}}
</div> {{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))}}
</div>
{{/if}} {{/if}}
{{/accordion-list-item}} {{/accordion-list-item}}
{{/accordion-list}} {{/accordion-list}}

View File

@ -2157,6 +2157,9 @@ clusterNew:
domain: Cluster Domain domain: Cluster Domain
dns: Cluster DNS Server dns: Cluster DNS Server
warning: 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: aws:
iam: 'An IAM role name should be provided in node template when using the Cloud Provider Amazon' iam: 'An IAM role name should be provided in node template when using the Cloud Provider Amazon'
errors: errors: