Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
Signed-off-by: Patryk Diak <[email protected]>
  • Loading branch information
kyrtapz committed Jan 23, 2025
1 parent 8943c1f commit 4324a64
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions go-controller/pkg/clustermanager/pod/allocator.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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
Expand All @@ -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)
}

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 4324a64

Please sign in to comment.