Skip to content

Commit 32ae888

Browse files
committed
zone wizard: allow only one untagged physical network with guest traffic type
1 parent 69e8ebc commit 32ae888

3 files changed

Lines changed: 28 additions & 3 deletions

File tree

ui/public/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2845,7 +2845,7 @@
28452845
"message.remove.vpc": "Please confirm that you want to remove the VPC",
28462846
"message.request.failed": "Request failed.",
28472847
"message.required.add.least.ip": "Please add at least 1 IP Range",
2848-
"message.required.traffic.type": "Error in configuration! All required traffic types should be added and with multiple physical networks each network should have a label.",
2848+
"message.required.traffic.type": "Error in configuration! All required traffic types should be added and with multiple physical networks each network should have a label. There can only be one untagged physical network with guest traffic type.",
28492849
"message.reset.vpn.connection": "Please confirm that you want to reset VPN connection.",
28502850
"message.resize.volume.failed": "Failed to resize volume.",
28512851
"message.resize.volume.processing": "Volume resize is in progress",

ui/src/views/infra/zone/ZoneWizardLaunchZone.vue

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -466,6 +466,9 @@ export default {
466466
if (physicalNetwork.isolationMethod) {
467467
params.isolationmethods = physicalNetwork.isolationMethod
468468
}
469+
if (physicalNetwork.tags) {
470+
params.tags = physicalNetwork.tags
471+
}
469472
470473
try {
471474
if (!this.stepData.stepMove.includes('createPhysicalNetwork' + index)) {

ui/src/views/infra/zone/ZoneWizardPhysicalNetworkSetupStep.vue

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,13 @@
133133
</a-tag>
134134
</div>
135135
</template>
136+
<template #tags="{ text, record, index }">
137+
<a-input
138+
:disabled="tungstenNetworkIndex > -1 && tungstenNetworkIndex !== index"
139+
:value="text"
140+
@change="e => onCellChange(record.key, 'tags', e.target.value)"
141+
/>
142+
</template>
136143
<template #actions="{ record, index }">
137144
<tooltip-button
138145
:tooltip="$t('label.delete')"
@@ -308,6 +315,13 @@ export default {
308315
width: 250,
309316
slots: { customRender: 'traffics' }
310317
})
318+
columns.push({
319+
title: this.$t('label.tags'),
320+
key: 'tags',
321+
dataIndex: 'tags',
322+
width: 175,
323+
slots: { customRender: 'tags' }
324+
})
311325
if (this.isAdvancedZone) {
312326
columns.push({
313327
title: '',
@@ -399,7 +413,7 @@ export default {
399413
return { type: item, label: '' }
400414
})
401415
this.count = 1
402-
this.physicalNetworks = [{ key: this.randomKeyTraffic(this.count), name: 'Physical Network 1', isolationMethod: 'VLAN', traffics: traffics }]
416+
this.physicalNetworks = [{ key: this.randomKeyTraffic(this.count), name: 'Physical Network 1', isolationMethod: 'VLAN', traffics: traffics, tags: null }]
403417
}
404418
if (this.isAdvancedZone) {
405419
this.availableTrafficToAdd.push('guest')
@@ -440,7 +454,8 @@ export default {
440454
key: this.randomKeyTraffic(count + 1),
441455
name: `Physical Network ${count + 1}`,
442456
isolationMethod: 'VLAN',
443-
traffics: []
457+
traffics: [],
458+
tags: null
444459
}
445460
this.physicalNetworks = [...physicalNetworks, newData]
446461
this.count = count + 1
@@ -456,12 +471,19 @@ export default {
456471
this.requiredTrafficTypes.forEach(type => {
457472
if (!isValid) return false
458473
let foundType = false
474+
let countPhysicalNetworkWithoutTags = 0
459475
physicalNetworks.forEach(net => {
460476
net.traffics.forEach(traffic => {
461477
if (!isValid) return false
462478
if (traffic.type === type) {
463479
foundType = true
464480
}
481+
if (traffic.type === 'guest' && type === 'guest' && (!net.tags || net.tags.length === 0)) {
482+
countPhysicalNetworkWithoutTags++
483+
}
484+
if (countPhysicalNetworkWithoutTags > 1) {
485+
isValid = false
486+
}
465487
if (this.hypervisor !== 'VMware') {
466488
if (shouldHaveLabels && (!traffic.label || traffic.label.length === 0)) {
467489
isValid = false

0 commit comments

Comments
 (0)