Skip to content

Commit fe98856

Browse files
committed
Allow at most one guest network with null tag in Zone creation wizard
1 parent 69e8ebc commit fe98856

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

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

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -453,6 +453,7 @@ export default {
453453
}
454454
const shouldHaveLabels = physicalNetworks.length > 1
455455
let isValid = true
456+
let guestTrafficNullCount = 0
456457
this.requiredTrafficTypes.forEach(type => {
457458
if (!isValid) return false
458459
let foundType = false
@@ -462,13 +463,20 @@ export default {
462463
if (traffic.type === type) {
463464
foundType = true
464465
}
466+
if (traffic.type === 'guest' && type === 'guest' && (!traffic.label || traffic.label.length === 0)) {
467+
guestTrafficNullCount++
468+
}
465469
if (this.hypervisor !== 'VMware') {
466470
if (shouldHaveLabels && (!traffic.label || traffic.label.length === 0)) {
467-
isValid = false
471+
if (!(traffic.type === 'guest' && foundType && guestTrafficNullCount <= 1)) {
472+
isValid = false
473+
}
468474
}
469475
} else {
470476
if (shouldHaveLabels && (!traffic.vSwitchName || traffic.vSwitchName.length === 0)) {
471-
isValid = false
477+
if (!(traffic.type === 'guest' && foundType && guestTrafficNullCount <= 1)) {
478+
isValid = false
479+
}
472480
}
473481
}
474482
})

0 commit comments

Comments
 (0)