Fix svc issue

This commit is contained in:
loganhz 2019-12-21 09:08:50 +08:00
parent ddfa30fbdb
commit 59b09ef762
1 changed files with 7 additions and 1 deletions

View File

@ -102,7 +102,7 @@ export default Component.extend(ViewNewEdit, ChildHook, {
if ( kind === HEADLESS ) { if ( kind === HEADLESS ) {
kind = CLUSTER_IP; kind = CLUSTER_IP;
set(this, 'model.clusterIp', 'None'); set(this, 'model.clusterIp', 'None');
} else { } else if ( this.mode === 'new' ) {
set(this, 'model.clusterIp', ''); set(this, 'model.clusterIp', '');
} }
@ -197,6 +197,12 @@ export default Component.extend(ViewNewEdit, ChildHook, {
delete get(this, 'model')[SELECTOR]; delete get(this, 'model')[SELECTOR];
} }
const ports = this.primaryResource.ports || [];
if ( this.primaryResource.kind !== LOAD_BALANCER && this.primaryResource.kind !== NODE_PORT ) {
ports.forEach((port) => delete port['nodePort']);
}
set(this, 'model.namespaceId', get(this, 'namespace.id') || '__placeholder__'); set(this, 'model.namespaceId', get(this, 'namespace.id') || '__placeholder__');
const self = this; const self = this;
const sup = this._super; const sup = this._super;