From 1c215f82f97158dbe31fe583841aa01fc963cd98 Mon Sep 17 00:00:00 2001 From: smallteeths <503630985@qq.com> Date: Thu, 16 Jan 2025 12:28:33 +0800 Subject: [PATCH] fix(macvlan v2) update annotation when selecting eth0 --- shell/edit/workload/mixins/workload.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/shell/edit/workload/mixins/workload.js b/shell/edit/workload/mixins/workload.js index fd8b00f4d18..481271dfeda 100644 --- a/shell/edit/workload/mixins/workload.js +++ b/shell/edit/workload/mixins/workload.js @@ -76,6 +76,7 @@ const GPU_KEY = 'nvidia.com/gpu'; const GPU_SHARED_KEY = 'rancher.io/gpu-mem'; const VGPU_KEY = 'virtaitech.com/gpu'; const DUAL_NETWORK_CARD = '[{"name":"static-macvlan-cni-attach","interface":"eth1"}]'; +const DUAL_NETWORK_CARDV2 = '[{"name":"rancher-flat-network","interface":"eth1"}]'; const MACVLAN_SERVICE = 'macvlan.panda.io/macvlanService'; const MACVLAN_ANNOTATION_MAP = { network: 'k8s.v1.cni.cncf.io/networks', @@ -1244,7 +1245,9 @@ export default { return; } - if (a === 'ip' || a === 'mac') { + if (a === 'network') { + form[propMap[`${ annotationsForm[a] === DUAL_NETWORK_CARDV2 ? a : `${ a }0` }`]] = annotationsForm[a]; + } else if (a === 'ip' || a === 'mac') { const key = a === 'ip' ? 'ipV2' : 'macV2'; if (!annotationsForm[a]) {