mirror of https://github.com/rancher/ui.git
Fix [Windows] Unable to set windows node advanced options
https://github.com/rancher/rancher/issues/22059
This commit is contained in:
parent
a353a21a58
commit
ef6ac0189a
|
|
@ -677,12 +677,18 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const address = get(this, 'address');
|
const address = get(this, 'address');
|
||||||
const nodeName = get(this, 'nodeName');
|
const nodeName = get(this, 'nodeName');
|
||||||
const internalAddress = get(this, 'internalAddress');
|
const internalAddress = get(this, 'internalAddress');
|
||||||
const roles = ['etcd', 'controlplane', 'worker'];
|
const roles = ['etcd', 'controlplane', 'worker'];
|
||||||
const labels = get(this, 'labels') || {};
|
const labels = get(this, 'labels') || {};
|
||||||
const taints = get(this, 'taints') || [];
|
const taints = get(this, 'taints') || [];
|
||||||
|
const windowsSelected = !get(this, 'isLinux')
|
||||||
|
const windowsCmdPostfix = ' | iex}"';
|
||||||
|
|
||||||
|
if (windowsSelected) {
|
||||||
|
out = (get(this, 'token.windowsNodeCommand') || '').replace('--isolation hyperv ', '').replace(windowsCmdPostfix, '')
|
||||||
|
}
|
||||||
|
|
||||||
if ( nodeName ) {
|
if ( nodeName ) {
|
||||||
out += ` --node-name ${ nodeName.toLowerCase() }`;
|
out += ` --node-name ${ nodeName.toLowerCase() }`;
|
||||||
|
|
@ -712,40 +718,8 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, {
|
||||||
out += ` --taints ${ get(taint, 'key') }=${ get(taint, 'value') }:${ get(taint, 'effect') }`;
|
out += ` --taints ${ get(taint, 'key') }=${ get(taint, 'value') }:${ get(taint, 'effect') }`;
|
||||||
});
|
});
|
||||||
|
|
||||||
const windowsSelected = !get(this, 'isLinux')
|
|
||||||
|
|
||||||
if (windowsSelected) {
|
if (windowsSelected) {
|
||||||
out = get(this, 'token.windowsNodeCommand') || ''
|
out += windowsCmdPostfix
|
||||||
out = out.replace('--isolation hyperv ', '')
|
|
||||||
let addressCmd = ''
|
|
||||||
|
|
||||||
if ( nodeName ) {
|
|
||||||
addressCmd += ` -nodeName ${ nodeName.toLowerCase() }`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (address) {
|
|
||||||
addressCmd += ` -address ${ address }`
|
|
||||||
}
|
|
||||||
|
|
||||||
if (internalAddress) {
|
|
||||||
addressCmd += ` -internalAddress ${ internalAddress }`
|
|
||||||
}
|
|
||||||
|
|
||||||
const labelKeys = Object.keys(labels);
|
|
||||||
|
|
||||||
if ( get(labelKeys, 'length') > 0 ) {
|
|
||||||
addressCmd += ` -label `;
|
|
||||||
const labelArray = [];
|
|
||||||
|
|
||||||
labelKeys.forEach((key) => {
|
|
||||||
labelArray.push(`${ key }=${ labels[key] }`);
|
|
||||||
});
|
|
||||||
addressCmd += `${ labelArray.join(',') }`;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (addressCmd) {
|
|
||||||
out = out.replace(`; if($?)`, `${ addressCmd }; if($?)`)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return out;
|
return out;
|
||||||
|
|
|
||||||
|
|
@ -1171,15 +1171,15 @@
|
||||||
</button>
|
</button>
|
||||||
{{/form-user-labels}}
|
{{/form-user-labels}}
|
||||||
|
|
||||||
{{#unless cluster.windowsPreferedCluster}}
|
<div class="row mt-20 mb-20">
|
||||||
<div class="row mt-20 mb-20">
|
{{t "clusterNew.rke.taints.title"}}
|
||||||
{{t "clusterNew.rke.taints.title"}}
|
<p class="help-block">
|
||||||
<p class="help-block">
|
{{t "clusterNew.rke.taints.detail"}}
|
||||||
{{t "clusterNew.rke.taints.detail"}}
|
</p>
|
||||||
</p>
|
{{node-taints
|
||||||
{{node-taints setTaints=(action "setTaints")}}
|
setTaints=(action "setTaints")
|
||||||
</div>
|
}}
|
||||||
{{/unless}}
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue