@@ -170,7 +170,7 @@ func (c *PodController) deletePod(obj interface{}) {
170
170
}
171
171
}
172
172
173
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
173
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
174
174
// klog.Infof("[POD DELETE EVENT] for %s in %s", podObj.Name, podObj.Namespace)
175
175
if isHostNetworkPod (podObj ) {
176
176
return
@@ -192,14 +192,14 @@ func (c *PodController) Run(stopCh <-chan struct{}) {
192
192
defer utilruntime .HandleCrash ()
193
193
defer c .workqueue .ShutDown ()
194
194
195
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
195
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
196
196
// klog.Infof("Starting Pod worker")
197
197
go wait .Until (c .runWorker , time .Second , stopCh )
198
198
199
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
199
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
200
200
// klog.Info("Started Pod workers")
201
201
<- stopCh
202
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
202
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
203
203
// klog.Info("Shutting down Pod workers")
204
204
}
205
205
@@ -238,7 +238,7 @@ func (c *PodController) processNextWorkItem() bool {
238
238
// Finally, if no error occurs we Forget this item so it does not
239
239
// get queued again until another change happens.
240
240
c .workqueue .Forget (obj )
241
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
241
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
242
242
// klog.Infof("Successfully synced '%s'", key)
243
243
return nil
244
244
}(obj )
@@ -352,7 +352,7 @@ func (c *PodController) syncPod(key string) error {
352
352
}
353
353
354
354
func (c * PodController ) syncAddedPod (podObj * corev1.Pod ) error {
355
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
355
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
356
356
// klog.Infof("POD CREATING: [%s/%s/%s/%s/%+v/%s]", string(podObj.GetUID()), podObj.Namespace,
357
357
// podObj.Name, podObj.Spec.NodeName, podObj.Labels, podObj.Status.PodIP)
358
358
@@ -375,7 +375,7 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
375
375
namespaceSet := []* ipsets.IPSetMetadata {ipsets .NewIPSetMetadata (podObj .Namespace , ipsets .Namespace )}
376
376
377
377
// Add the pod ip information into namespace's ipset.
378
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
378
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
379
379
// klog.Infof("Adding pod %s (ip : %s) to ipset %s", podKey, podObj.Status.PodIP, podObj.Namespace)
380
380
if err = c .dp .AddToSets (namespaceSet , podMetadata ); err != nil {
381
381
return fmt .Errorf ("[syncAddedPod] Error: failed to add pod to namespace ipset with err: %w" , err )
@@ -394,7 +394,7 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
394
394
targetSetKeyValue := ipsets .NewIPSetMetadata (labelKeyValue , ipsets .KeyValueLabelOfPod )
395
395
allSets := []* ipsets.IPSetMetadata {targetSetKey , targetSetKeyValue }
396
396
397
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
397
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
398
398
// klog.Infof("Creating ipsets %+v and %+v if they do not exist", targetSetKey, targetSetKeyValue)
399
399
// klog.Infof("Adding pod %s (ip : %s) to ipset %s and %s", podKey, npmPodObj.PodIP, labelKey, labelKeyValue)
400
400
if err = c .dp .AddToSets (allSets , podMetadata ); err != nil {
@@ -404,7 +404,7 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
404
404
}
405
405
406
406
// Add pod's named ports from its ipset.
407
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
407
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
408
408
// klog.Infof("Adding named port ipsets")
409
409
containerPorts := common .GetContainerPortList (podObj )
410
410
if err = c .manageNamedPortIpsets (containerPorts , podKey , npmPodObj .PodIP , podObj .Spec .NodeName , addNamedPort ); err != nil {
@@ -439,7 +439,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
439
439
c .npmNamespaceCache .Unlock ()
440
440
441
441
cachedNpmPod , exists := c .podMap [podKey ]
442
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
442
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
443
443
// klog.Infof("[syncAddAndUpdatePod] updating Pod with key %s", podKey)
444
444
// No cached npmPod exists. start adding the pod in a cache
445
445
if ! exists {
@@ -456,17 +456,17 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
456
456
// NPM should clean up existing references of cached pod obj and its IP.
457
457
// then, re-add new pod obj.
458
458
if cachedNpmPod .PodIP != newPodObj .Status .PodIP {
459
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
459
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
460
460
// klog.Infof("Pod (Namespace:%s, Name:%s, newUid:%s), has cachedPodIp:%s which is different from PodIp:%s",
461
461
// newPodObj.Namespace, newPodObj.Name, string(newPodObj.UID), cachedNpmPod.PodIP, newPodObj.Status.PodIP)
462
462
463
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
463
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
464
464
// klog.Infof("Deleting cached Pod with key:%s first due to IP Mistmatch", podKey)
465
465
if er := c .cleanUpDeletedPod (podKey ); er != nil {
466
466
return metrics .UpdateOp , er
467
467
}
468
468
469
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
469
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
470
470
// klog.Infof("Adding back Pod with key:%s after IP Mistmatch", podKey)
471
471
return metrics .UpdateOp , c .syncAddedPod (newPodObj )
472
472
}
@@ -481,7 +481,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
481
481
cachedPodMetadata := dataplane .NewPodMetadata (podKey , cachedNpmPod .PodIP , newPodMetadata .NodeName )
482
482
// Delete the pod from its label's ipset.
483
483
for _ , removeIPSetName := range deleteFromIPSets {
484
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
484
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
485
485
// klog.Infof("Deleting pod %s (ip : %s) from ipset %s", podKey, cachedNpmPod.PodIP, removeIPSetName)
486
486
487
487
var toRemoveSet * ipsets.IPSetMetadata
@@ -504,7 +504,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
504
504
// Add the pod to its label's ipset.
505
505
for _ , addIPSetName := range addToIPSets {
506
506
507
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
507
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
508
508
// klog.Infof("Creating ipset %s if it doesn't already exist", addIPSetName)
509
509
510
510
var toAddSet * ipsets.IPSetMetadata
@@ -514,7 +514,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
514
514
toAddSet = ipsets .NewIPSetMetadata (addIPSetName , ipsets .KeyLabelOfPod )
515
515
}
516
516
517
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
517
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
518
518
// klog.Infof("Adding pod %s (ip : %s) to ipset %s", podKey, newPodObj.Status.PodIP, addIPSetName)
519
519
if err = c .dp .AddToSets ([]* ipsets.IPSetMetadata {toAddSet }, newPodMetadata ); err != nil {
520
520
return metrics .UpdateOp , fmt .Errorf ("[syncAddAndUpdatePod] Error: failed to add pod to label ipset with err: %w" , err )
@@ -558,7 +558,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
558
558
559
559
// cleanUpDeletedPod cleans up all ipset associated with this pod
560
560
func (c * PodController ) cleanUpDeletedPod (cachedNpmPodKey string ) error {
561
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
561
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
562
562
// klog.Infof("[cleanUpDeletedPod] deleting Pod with key %s", cachedNpmPodKey)
563
563
// If cached npmPod does not exist, return nil
564
564
cachedNpmPod , exist := c .podMap [cachedNpmPodKey ]
@@ -579,7 +579,7 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
579
579
// Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start deleting them from ipsets
580
580
for labelKey , labelVal := range cachedNpmPod .Labels {
581
581
labelKeyValue := util .GetIpSetFromLabelKV (labelKey , labelVal )
582
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
582
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
583
583
// klog.Infof("Deleting pod %s (ip : %s) from ipsets %s and %s", cachedNpmPodKey, cachedNpmPod.PodIP, labelKey, labelKeyValue)
584
584
if err = c .dp .RemoveFromSets (
585
585
[]* ipsets.IPSetMetadata {
@@ -613,7 +613,7 @@ func (c *PodController) manageNamedPortIpsets(portList []corev1.ContainerPort, p
613
613
return nil
614
614
}
615
615
for _ , port := range portList {
616
- // TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
616
+ // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
617
617
// klog.Infof("port is %+v", port)
618
618
if port .Name == "" {
619
619
continue
0 commit comments