From 4324a64470b59b2fba1e94e49148b96267167bdf Mon Sep 17 00:00:00 2001 From: Patryk Diak Date: Thu, 23 Jan 2025 16:50:04 +0100 Subject: [PATCH] wip Signed-off-by: Patryk Diak --- go-controller/pkg/clustermanager/pod/allocator.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/go-controller/pkg/clustermanager/pod/allocator.go b/go-controller/pkg/clustermanager/pod/allocator.go index 01af49f594..234f29a37e 100644 --- a/go-controller/pkg/clustermanager/pod/allocator.go +++ b/go-controller/pkg/clustermanager/pod/allocator.go @@ -209,6 +209,8 @@ func (a *PodAllocator) reconcile(old, new *corev1.Pod, releaseFromAllocator bool return fmt.Errorf("failed looking for an active network: %w", err) } + klog.Infof("[DBG] Active network for %s/%s: %s", pod.Namespace, pod.Name, activeNetwork.GetNetworkName()) + onNetwork, networkMap, err := util.GetPodNADToNetworkMappingWithActiveNetwork(pod, a.netInfo, activeNetwork) if err != nil { a.recordPodErrorEvent(pod, err) @@ -224,6 +226,7 @@ func (a *PodAllocator) reconcile(old, new *corev1.Pod, releaseFromAllocator bool // reconcile for each NAD for nadName, network := range networkMap { + klog.Infof("[DBG] reconcileForNAD %s/%s: %s", pod.Namespace, pod.Name, network.Name) err = a.reconcileForNAD(old, new, nadName, network, releaseFromAllocator) if err != nil { return err @@ -245,9 +248,10 @@ func (a *PodAllocator) reconcileForNAD(old, new *corev1.Pod, nad string, network podCompleted := util.PodCompleted(pod) if podCompleted || podDeleted { + klog.Infof("[DBG] releasePodOnNAD %s/%s: %s", pod.Namespace, pod.Name, network.Name) return a.releasePodOnNAD(pod, nad, network, podDeleted, releaseIPsFromAllocator) } - + klog.Infof("[DBG] allocatePodOnNAD %s/%s: %s", pod.Namespace, pod.Name, network.Name) return a.allocatePodOnNAD(pod, nad, network) } @@ -359,7 +363,7 @@ func (a *PodAllocator) allocatePodOnNAD(pod *corev1.Pod, nad string, network *ne } if updatedPod != nil { - klog.V(5).Infof("Allocated IP addresses %v, mac address %s, gateways %v, routes %s and tunnel id %d for pod %s/%s on nad %s", + klog.Infof("[DBG] Allocated IP addresses %v, mac address %s, gateways %v, routes %s and tunnel id %d for pod %s/%s on nad %s", util.StringSlice(podAnnotation.IPs), podAnnotation.MAC, util.StringSlice(podAnnotation.Gateways),