mirror of https://github.com/rancher/ui.git
rework showManagementWarning to computed property only imported
This commit is contained in:
parent
0770ea31a0
commit
ea89a726d7
|
|
@ -28,12 +28,11 @@ export default Component.extend({
|
|||
nodeVersions: null,
|
||||
controlPlaneVersion: null,
|
||||
upgradeVersion: false,
|
||||
showManagementWarning: false,
|
||||
|
||||
init() {
|
||||
this._super(...arguments);
|
||||
|
||||
const { nodePool, originalCluster } = this;
|
||||
const { nodePool } = this;
|
||||
|
||||
setProperties(this, {
|
||||
scopeConfig: {},
|
||||
|
|
@ -55,12 +54,6 @@ export default Component.extend({
|
|||
if (isEmpty(this?.nodePool?.version) && !isEmpty(this?.cluster?.gkeConfig?.kubernetesVersion)) {
|
||||
set(this, 'nodePool.version', this?.cluster?.gkeConfig?.kubernetesVersion);
|
||||
}
|
||||
|
||||
const isClusterImported = !isEmpty(originalCluster) && originalCluster?.gkeStatus?.upstreamSpec?.imported;
|
||||
|
||||
if (isClusterImported && !nodePool?.management?.autoRepair && !nodePool?.management?.autoUpgrade) {
|
||||
set(this, 'showManagementWarning', true);
|
||||
}
|
||||
} else {
|
||||
setProperties(this, {
|
||||
oauthScopesSelection: this.google.oauthScopeOptions.DEFAULT,
|
||||
|
|
@ -130,6 +123,18 @@ export default Component.extend({
|
|||
set(this.nodePool.config, 'oauthScopes', this.google.mapOauthScopes(this.oauthScopesSelection, this.scopeConfig));
|
||||
})),
|
||||
|
||||
showManagementWarning: computed('originalCluster.gkeStatus.upstreamSpec.imported', 'nodePool.management.{autoUpgrade,autoRepair}', function() {
|
||||
const { nodePool, originalCluster } = this;
|
||||
|
||||
const isClusterImported = !isEmpty(originalCluster) && originalCluster?.gkeStatus?.upstreamSpec?.imported;
|
||||
|
||||
if (isClusterImported && ( !nodePool?.management?.autoRepair || !nodePool?.management?.autoUpgrade )) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}),
|
||||
|
||||
originalClusterVersion: computed('originalCluster.gkeConfig.kubernetesVersion', 'originalCluster.gkeStatus.upstreamSpec.kubernetesVersion', function() {
|
||||
if (!isEmpty(get(this, 'originalCluster.gkeConfig.kubernetesVersion'))) {
|
||||
return get(this, 'originalCluster.gkeConfig.kubernetesVersion');
|
||||
|
|
|
|||
Loading…
Reference in New Issue