mirror of https://github.com/rancher/ui.git
Delete port names on clone (rancher/rancher#14018)
This commit is contained in:
parent
743228ea40
commit
0353a047d6
|
|
@ -18,8 +18,7 @@ export default Route.extend({
|
||||||
var store = get(this, 'store');
|
var store = get(this, 'store');
|
||||||
|
|
||||||
const gs = get(this, 'globalStore');
|
const gs = get(this, 'globalStore');
|
||||||
const project = window.l('route:application').modelFor('authenticated.project')
|
const project = window.l('route:application').modelFor('authenticated.project').get('project');
|
||||||
.get('project');
|
|
||||||
const projectId = project.get('id');
|
const projectId = project.get('id');
|
||||||
const clusterId = project.get('clusterId');
|
const clusterId = project.get('clusterId');
|
||||||
|
|
||||||
|
|
@ -77,6 +76,7 @@ export default Route.extend({
|
||||||
}
|
}
|
||||||
|
|
||||||
},
|
},
|
||||||
|
|
||||||
modelForNew(params) {
|
modelForNew(params) {
|
||||||
|
|
||||||
let scaleMode = get(this, `prefs.${ C.PREFS.LAST_SCALE_MODE }`) || 'deployment';
|
let scaleMode = get(this, `prefs.${ C.PREFS.LAST_SCALE_MODE }`) || 'deployment';
|
||||||
|
|
@ -218,6 +218,16 @@ export default Route.extend({
|
||||||
|
|
||||||
// Clone workload with one container
|
// Clone workload with one container
|
||||||
let neu = get(this, 'store').createRecord(clone.serializeForNew());
|
let neu = get(this, 'store').createRecord(clone.serializeForNew());
|
||||||
|
delete neu.deploymentStatus;
|
||||||
|
container = neu.containers[0];
|
||||||
|
|
||||||
|
// Cleanup port mappings so they get new services
|
||||||
|
(neu.containers||[]).forEach((container) => {
|
||||||
|
(container.ports||[]).forEach((port) => {
|
||||||
|
delete port.name;
|
||||||
|
delete port.dnsName;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
return EmberObject.create({
|
return EmberObject.create({
|
||||||
scaleMode: clone.type,
|
scaleMode: clone.type,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue