Skip to content

Commit 47f3730

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

3 files changed

Lines changed: 25 additions & 1 deletion

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: 21 additions & 0 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: '',
@@ -456,12 +470,19 @@ export default {
456470
this.requiredTrafficTypes.forEach(type => {
457471
if (!isValid) return false
458472
let foundType = false
473+
let countPhysicalNetworkWithoutTags = 0
459474
physicalNetworks.forEach(net => {
460475
net.traffics.forEach(traffic => {
461476
if (!isValid) return false
462477
if (traffic.type === type) {
463478
foundType = true
464479
}
480+
if (traffic.type === 'guest' && type === 'guest' && (net.tags === null || net.tags === '')) {
481+
countPhysicalNetworkWithoutTags++
482+
}
483+
if (countPhysicalNetworkWithoutTags > 1) {
484+
isValid = false
485+
}
465486
if (this.hypervisor !== 'VMware') {
466487
if (shouldHaveLabels && (!traffic.label || traffic.label.length === 0)) {
467488
isValid = false

0 commit comments

Comments
 (0)