Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3147,8 +3147,12 @@ public Network updateGuestNetwork(final UpdateNetworkCmd cmd) {
}

// network offering and domain suffix can be updated for Isolated networks only in 3.0
if ((networkOfferingId != null || domainSuffix != null) && network.getGuestType() != GuestType.Isolated) {
throw new InvalidParameterValueException("NetworkOffering and domain suffix upgrade can be performed for Isolated networks only");
if (networkOfferingId != null && network.getGuestType() != GuestType.Isolated) {
throw new InvalidParameterValueException("NetworkOffering update can be performed for Isolated networks only.");
}
// network offering and domain suffix can be updated for Isolated networks only in 3.0
if (domainSuffix != null && ! Arrays.asList(GuestType.Isolated, GuestType.Shared).contains(network.getGuestType())) {
Comment thread
weizhouapache marked this conversation as resolved.
throw new InvalidParameterValueException("Domain suffix update can only be performed for Isolated and shared networks.");
}

boolean networkOfferingChanged = false;
Expand Down
10 changes: 8 additions & 2 deletions ui/src/views/network/UpdateNetwork.vue
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
</template>
<a-switch v-model:checked="form.changecidr" />
</a-form-item>
<a-form-item name="networkdomain" ref="networkdomain" v-if="isUpdatingIsolatedNetwork">
<a-form-item name="networkdomain" ref="networkdomain" v-if="hasNetworkDomain">
<template #label>
<tooltip-label :title="$t('label.networkdomain')" :tooltip="apiParams.guestvmcidr.description"/>
</template>
Expand Down Expand Up @@ -274,7 +274,7 @@ export default {
ip6dns1: this.resource.ip6dns1,
ip6dns2: this.resource.ip6dns2
}
if (this.isUpdatingIsolatedNetwork) {
if (this.hasNetworkDomain) {
this.resourceValues.networkdomain = this.resource.networkdomain
}
for (var field in this.resourceValues) {
Expand All @@ -289,6 +289,12 @@ export default {
isUpdatingIsolatedNetwork () {
return this.resource && this.resource.type === 'Isolated'
},
isUpdatingSharedNetwork () {
return this.resource && this.resource.type === 'Shared'
},
hasNetworkDomain () {
return this.isUpdatingIsolatedNetwork || this.isUpdatingSharedNetwork
},
selectedNetworkOfferingSupportsDns () {
if (this.networkOffering) {
const services = this.networkOffering?.service || []
Expand Down