diff --git a/calico-vpp-agent/cni/storage/storage.go b/calico-vpp-agent/cni/storage/storage.go index b81345ae..28b3847f 100644 --- a/calico-vpp-agent/cni/storage/storage.go +++ b/calico-vpp-agent/cni/storage/storage.go @@ -305,7 +305,7 @@ func TruncateStr(text string, size int) string { func (ps *LocalPodSpec) GetVrfTag(ipFamily vpplink.IpFamily, custom string) string { h := hash(fmt.Sprintf("%s%s%s%s", ipFamily.ShortStr, ps.NetnsName, ps.InterfaceName, custom)) - s := fmt.Sprintf("%s-%s-%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, filepath.Base(ps.NetnsName)) + s := fmt.Sprintf("%s-%s-%s%s-%s", h, ipFamily.ShortStr, ps.InterfaceName, custom, filepath.Base(ps.NetnsName)) return TruncateStr(s, MaxApiTagLen) } diff --git a/calico-vpp-agent/common_tests/common_tests.go b/calico-vpp-agent/common_tests/common_tests.go index 126c957a..8814569b 100644 --- a/calico-vpp-agent/common_tests/common_tests.go +++ b/calico-vpp-agent/common_tests/common_tests.go @@ -128,7 +128,7 @@ func AssertRPFVRFExistence(vpp *vpplink.VppLink, interfaceName string, netnsName "Failed to retrieve list of VRFs in VPP") hbytes := sha512.Sum512([]byte(fmt.Sprintf("%s%s%s%s", "4", netnsName, interfaceName, "RPF"))) h := base64.StdEncoding.EncodeToString(hbytes[:])[:storage.VrfTagHashLen] - s := fmt.Sprintf("%s-%s-%s-%s", h, "4", interfaceName, filepath.Base(netnsName)) + s := fmt.Sprintf("%s-%s-%sRPF-%s", h, "4", interfaceName, filepath.Base(netnsName)) vrfTag := storage.TruncateStr(s, storage.MaxApiTagLen) foundRPFVRF := false var vrfID uint32