diff --git a/pkg/harvester/edit/kubeovn.io.subnet/index.vue b/pkg/harvester/edit/kubeovn.io.subnet/index.vue index d648e8e3..3ad6246c 100644 --- a/pkg/harvester/edit/kubeovn.io.subnet/index.vue +++ b/pkg/harvester/edit/kubeovn.io.subnet/index.vue @@ -43,18 +43,20 @@ export default { created() { const vpc = this.$route.query.vpc || ''; const enableDHCP = this.value?.spec?.enableDHCP || false; + const natOutgoing = this.value?.spec?.natOutgoing || false; set(this.value.spec, 'enableDHCP', enableDHCP); set(this.value, 'spec', this.value.spec || { - cidrBlock: '', - protocol: NETWORK_PROTOCOL.IPv4, - provider: '', + cidrBlock: '', + protocol: NETWORK_PROTOCOL.IPv4, + provider: '', vpc, - gatewayIP: '', - excludeIps: [], - private: false, + gateway: '', + excludeIps: [], + private: false, enableDHCP, - acls: [] + natOutgoing, + acls: [] }); }, @@ -129,6 +131,10 @@ export default { label: n.id, value: n.id, })); + }, + natOutgoingDisabled() { + // Disable the NAT Outgoing option when the subnet belongs to the ovn-cluster VPC and its name is join or ovn-default. + return this.value?.spec?.vpc === 'ovn-cluster' && ['join', 'ovn-default'].includes(this.value?.metadata?.name); } }, @@ -304,6 +310,20 @@ export default { +