Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package kubevirt for openSUSE:Factory 
checked in at 2024-04-12 17:35:04
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kubevirt (Old)
 and      /work/SRC/openSUSE:Factory/.kubevirt.new.26366 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kubevirt"

Fri Apr 12 17:35:04 2024 rev:73 rq:1166997 version:1.2.0

Changes:
--------
--- /work/SRC/openSUSE:Factory/kubevirt/kubevirt.changes        2024-03-06 
23:06:29.265571330 +0100
+++ /work/SRC/openSUSE:Factory/.kubevirt.new.26366/kubevirt.changes     
2024-04-12 17:40:24.548179999 +0200
@@ -1,0 +2,6 @@
+Fri Apr 12 05:51:30 UTC 2024 - Vasily Ulyanov <vasily.ulya...@suse.com>
+
+- Improve the OrdinalPodInterfaceName mechanism (bsc#1222699)
+  0001-Improve-the-handling-of-ordinal-pod-interface-name-for-upgrade.patch
+
+-------------------------------------------------------------------

New:
----
  0001-Improve-the-handling-of-ordinal-pod-interface-name-for-upgrade.patch

BETA DEBUG BEGIN:
  New:- Improve the OrdinalPodInterfaceName mechanism (bsc#1222699)
  0001-Improve-the-handling-of-ordinal-pod-interface-name-for-upgrade.patch
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kubevirt.spec ++++++
--- /var/tmp/diff_new_pack.xUeT6d/_old  2024-04-12 17:40:25.152202244 +0200
+++ /var/tmp/diff_new_pack.xUeT6d/_new  2024-04-12 17:40:25.156202391 +0200
@@ -41,6 +41,7 @@
 Source2:        kubevirt_containers_meta.service
 Source3:        %{url}/releases/download/v%{version}/disks-images-provider.yaml
 Source100:      %{name}-rpmlintrc
+Patch1:         
0001-Improve-the-handling-of-ordinal-pod-interface-name-for-upgrade.patch
 BuildRequires:  glibc-devel-static
 BuildRequires:  golang-packaging
 BuildRequires:  pkgconfig

++++++ 
0001-Improve-the-handling-of-ordinal-pod-interface-name-for-upgrade.patch ++++++
>From 0e9960022d6c0ecf525d4bc934becab6c536b921 Mon Sep 17 00:00:00 2001
From: Vicente Cheng <vicente.ch...@suse.com>
Date: Wed, 10 Apr 2024 00:47:44 +0800
Subject: [PATCH 1/2] network: add more network name scheme test cases

    - Add different order to verify the correct interface name
    - Add only one secondary network to verify the correct interface name

Signed-off-by: Vicente Cheng <vicente.ch...@suse.com>
---
 pkg/network/namescheme/networknamescheme_test.go | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/pkg/network/namescheme/networknamescheme_test.go 
b/pkg/network/namescheme/networknamescheme_test.go
index 8fe85485006a..7b6fe8f562f4 100644
--- a/pkg/network/namescheme/networknamescheme_test.go
+++ b/pkg/network/namescheme/networknamescheme_test.go
@@ -259,6 +259,22 @@ var _ = Describe("Network Name Scheme", func() {
                                },
                                "net2",
                        ),
+                       Entry("given secondary network name with different 
order",
+                               "multus01",
+                               []virtv1.Network{
+                                       createMultusSecondaryNetwork("blue", 
"test-br"),
+                                       
createMultusSecondaryNetwork("multus01", "test-br"),
+                                       newPodNetwork(),
+                               },
+                               "net2",
+                       ),
+                       Entry("given secondary network name, only one secondary 
network",
+                               "multus01",
+                               []virtv1.Network{
+                                       
createMultusSecondaryNetwork("multus01", "test-br"),
+                               },
+                               "net1",
+                       ),
                )
        })
 })

>From 3d22893dda229cfd0793beb54cf64271f9b69a17 Mon Sep 17 00:00:00 2001
From: Vicente Cheng <vicente.ch...@suse.com>
Date: Wed, 10 Apr 2024 01:10:36 +0800
Subject: [PATCH 2/2] network: improve the OrdinalPodInterfaceName mechanism

    - the networks are not ordered, means the pod network is not always
      on the first. We should consider more to get the secondary network
      because the secondary started from 1 to n.
    - Also, we should consider only have one multus and secondary
      network situation.

    This change mainly finetune the mechanism for get the secondary
    multus network.

Signed-off-by: Vicente Cheng <vicente.ch...@suse.com>
---
 pkg/network/namescheme/networknamescheme.go | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/pkg/network/namescheme/networknamescheme.go 
b/pkg/network/namescheme/networknamescheme.go
index b2be1d62e54d..470151c91806 100644
--- a/pkg/network/namescheme/networknamescheme.go
+++ b/pkg/network/namescheme/networknamescheme.go
@@ -92,17 +92,13 @@ func CreateOrdinalNetworkNameScheme(vmiNetworks 
[]v1.Network) map[string]string
        return networkNameSchemeMap
 }
 
+// OrdinalPodInterfaceName returns the ordinal interface name for the given 
network name.
+// Rereuse the `CreateOrdinalNetworkNameScheme` for various networks helps 
find the target interface name.
 func OrdinalPodInterfaceName(name string, networks []v1.Network) string {
-       for i, network := range networks {
-               if network.Name == name {
-                       if vmispec.IsSecondaryMultusNetwork(network) {
-                               return generateOrdinalInterfaceName(i)
-                       }
-
-                       return PrimaryPodInterfaceName
-               }
+       networkNameSchemeMap := CreateOrdinalNetworkNameScheme(networks)
+       if ordinalName, exist := networkNameSchemeMap[name]; exist {
+               return ordinalName
        }
-
        return ""
 }
 

Reply via email to