diff --git a/pkg/macvlan/components/subnetView.vue b/pkg/macvlan/components/subnetView.vue index 43a527b7f03..51e07aca4e0 100644 --- a/pkg/macvlan/components/subnetView.vue +++ b/pkg/macvlan/components/subnetView.vue @@ -53,6 +53,13 @@ export default { return this.config?.spec?.routeSettings?.addClusterCIDR || this.config?.spec?.routeSettings?.addServiceCIDR || this.config?.spec?.routeSettings?.addNodeCIDR; + }, + showAdvanced() { + return this.routes.length > 0 || + this.ranges.length > 0 || + this.showPodRouteSettings || + this.config?.spec?.routeSettings?.addPodIPToHost || + this.config?.spec?.routeSettings?.flatNetworkDefaultGateway; } } }; @@ -112,7 +119,7 @@ export default { !!r.via && !(ipv4RegExp.test(r.via) || ipv6RegExp.test(r.via)) )) { return this.t('macvlan.route.routeViaFormatError'); } - if (value.some((r) => !!r.src && !(ipv4RegExp.test(r.via) || ipv6RegExp.test(r.via)) && !this.ipCIDRContains(this.config.spec.cidr, r.src) )) { + if (value.some((r) => !!r.src && !(ipv4RegExp.test(r.src) || ipv6RegExp.test(r.src)) && !this.ipCIDRContains(this.config.spec.cidr, r.src) )) { return this.t('macvlan.route.routeSrcFormatError'); } if (value.some((r) => !!r.priority && @@ -322,7 +330,6 @@ export default { this.config.spec.mode = 'l2'; } }, - immediate: true, } },