Skip to content

Commit 821c9ef

Browse files
committed
fixed typo
1 parent b72bec7 commit 821c9ef

File tree

8 files changed

+75
-75
lines changed

8 files changed

+75
-75
lines changed

npm/pkg/controlplane/controllers/v2/namespaceController.go

+12-12
Original file line numberDiff line numberDiff line change
@@ -164,16 +164,16 @@ func (nsc *NamespaceController) Run(stopCh <-chan struct{}) {
164164
defer utilruntime.HandleCrash()
165165
defer nsc.workqueue.ShutDown()
166166

167-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
167+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
168168
// klog.Info("Starting Namespace controller\n")
169169
// klog.Info("Starting workers")
170170
// Launch workers to process namespace resources
171171
go wait.Until(nsc.runWorker, time.Second, stopCh)
172172

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
174174
// klog.Info("Started workers")
175175
<-stopCh
176-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
176+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
177177
// klog.Info("Shutting down workers")
178178
}
179179

@@ -212,7 +212,7 @@ func (nsc *NamespaceController) processNextWorkItem() bool {
212212
// Finally, if no error occurs we Forget this item so it does not
213213
// get queued again until another change happens.
214214
nsc.workqueue.Forget(obj)
215-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
215+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
216216
// klog.Infof("Successfully synced '%s'", key)
217217
return nil
218218
}(obj)
@@ -325,7 +325,7 @@ func (nsc *NamespaceController) syncAddNamespace(nsObj *corev1.Namespace) error
325325
// Add the namespace to its label's ipset list.
326326
for nsLabelKey, nsLabelVal := range nsObj.ObjectMeta.Labels {
327327
nsLabelKeyValue := util.GetIpSetFromLabelKV(nsLabelKey, nsLabelVal)
328-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
328+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
329329
// klog.Infof("Adding namespace %s to ipset list %s and %s", nsObj.ObjectMeta.Name, nsLabelKey, nsLabelKeyValue)
330330
labelIPSets := []*ipsets.IPSetMetadata{
331331
ipsets.NewIPSetMetadata(nsLabelKey, ipsets.KeyLabelOfNamespace),
@@ -349,7 +349,7 @@ func (nsc *NamespaceController) syncAddNamespace(nsObj *corev1.Namespace) error
349349
func (nsc *NamespaceController) syncUpdateNamespace(newNsObj *corev1.Namespace) (metrics.OperationKind, error) {
350350
var err error
351351
newNsName, newNsLabel := newNsObj.ObjectMeta.Name, newNsObj.ObjectMeta.Labels
352-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
352+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
353353
// klog.Infof("NAMESPACE UPDATING:\n namespace: [%s/%v]", newNsName, newNsLabel)
354354

355355
// If previous syncAddNamespace failed for some reasons
@@ -379,7 +379,7 @@ func (nsc *NamespaceController) syncUpdateNamespace(newNsObj *corev1.Namespace)
379379
}
380380
toBeRemoved := []*ipsets.IPSetMetadata{ipsets.NewIPSetMetadata(newNsName, ipsets.Namespace)}
381381

382-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
382+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
383383
// klog.Infof("Deleting namespace %s from ipset list %s", newNsName, nsLabelVal)
384384
if err = nsc.dp.RemoveFromList(labelSet, toBeRemoved); err != nil {
385385
metrics.SendErrorLogAndMetric(util.NSID, "[UpdateNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", newNsName, nsLabelVal, err)
@@ -396,7 +396,7 @@ func (nsc *NamespaceController) syncUpdateNamespace(newNsObj *corev1.Namespace)
396396

397397
// Add the namespace to its label's ipset list.
398398
for _, nsLabelVal := range addToIPSets {
399-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
399+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
400400
// klog.Infof("Adding namespace %s to ipset list %s", newNsName, nsLabelVal)
401401

402402
var labelSet []*ipsets.IPSetMetadata
@@ -430,13 +430,13 @@ func (nsc *NamespaceController) syncUpdateNamespace(newNsObj *corev1.Namespace)
430430

431431
// cleanDeletedNamespace handles deleting namespace from ipset.
432432
func (nsc *NamespaceController) cleanDeletedNamespace(cachedNsKey string) error {
433-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
433+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
434434
// klog.Infof("NAMESPACE DELETING: [%s]", cachedNsKey)
435435
cachedNsObj, exists := nsc.npmNamespaceCache.NsMap[cachedNsKey]
436436
if !exists {
437437
return nil
438438
}
439-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
439+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
440440
// klog.Infof("NAMESPACE DELETING cached labels: [%s/%v]", cachedNsKey, cachedNsObj.LabelsMap)
441441

442442
var err error
@@ -445,7 +445,7 @@ func (nsc *NamespaceController) cleanDeletedNamespace(cachedNsKey string) error
445445
for nsLabelKey, nsLabelVal := range cachedNsObj.LabelsMap {
446446

447447
labelKey := ipsets.NewIPSetMetadata(nsLabelKey, ipsets.KeyLabelOfNamespace)
448-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
448+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
449449
// klog.Infof("Deleting namespace %s from ipset list %s", cachedNsKey, labelKey)
450450
if err = nsc.dp.RemoveFromList(labelKey, toBeDeletedNs); err != nil {
451451
metrics.SendErrorLogAndMetric(util.NSID, "[DeleteNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", cachedNsKey, labelKey, err)
@@ -454,7 +454,7 @@ func (nsc *NamespaceController) cleanDeletedNamespace(cachedNsKey string) error
454454

455455
labelIpsetName := util.GetIpSetFromLabelKV(nsLabelKey, nsLabelVal)
456456
labelKeyValue := ipsets.NewIPSetMetadata(labelIpsetName, ipsets.KeyValueLabelOfNamespace)
457-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
457+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
458458
// klog.Infof("Deleting namespace %s from ipset list %s", cachedNsKey, labelIpsetName)
459459
if err = nsc.dp.RemoveFromList(labelKeyValue, toBeDeletedNs); err != nil {
460460
metrics.SendErrorLogAndMetric(util.NSID, "[DeleteNamespace] Error: failed to delete namespace %s from ipset list %s with err: %v", cachedNsKey, labelIpsetName, err)

npm/pkg/controlplane/controllers/v2/networkPolicyController.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -148,14 +148,14 @@ func (c *NetworkPolicyController) Run(stopCh <-chan struct{}) {
148148
defer utilruntime.HandleCrash()
149149
defer c.workqueue.ShutDown()
150150

151-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
151+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
152152
// klog.Infof("Starting Network Policy worker")
153153
go wait.Until(c.runWorker, time.Second, stopCh)
154154

155-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
155+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
156156
// klog.Infof("Started Network Policy worker")
157157
<-stopCh
158-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
158+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
159159
// klog.Info("Shutting down Network Policy workers")
160160
}
161161

@@ -193,7 +193,7 @@ func (c *NetworkPolicyController) processNextWorkItem() bool {
193193
// Finally, if no error occurs we Forget this item so it does not
194194
// get queued again until another change happens.
195195
c.workqueue.Forget(obj)
196-
// TODO: Refactor non-error/warning klogs with Vap and set the following logs to "debug" level
196+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
197197
// klog.Infof("Successfully synced '%s'", key)
198198
return nil
199199
}(obj)

npm/pkg/controlplane/controllers/v2/podController.go

+19-19
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ func (c *PodController) deletePod(obj interface{}) {
170170
}
171171
}
172172

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
174174
// klog.Infof("[POD DELETE EVENT] for %s in %s", podObj.Name, podObj.Namespace)
175175
if isHostNetworkPod(podObj) {
176176
return
@@ -192,14 +192,14 @@ func (c *PodController) Run(stopCh <-chan struct{}) {
192192
defer utilruntime.HandleCrash()
193193
defer c.workqueue.ShutDown()
194194

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
196196
// klog.Infof("Starting Pod worker")
197197
go wait.Until(c.runWorker, time.Second, stopCh)
198198

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
200200
// klog.Info("Started Pod workers")
201201
<-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
203203
// klog.Info("Shutting down Pod workers")
204204
}
205205

@@ -238,7 +238,7 @@ func (c *PodController) processNextWorkItem() bool {
238238
// Finally, if no error occurs we Forget this item so it does not
239239
// get queued again until another change happens.
240240
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
242242
// klog.Infof("Successfully synced '%s'", key)
243243
return nil
244244
}(obj)
@@ -352,7 +352,7 @@ func (c *PodController) syncPod(key string) error {
352352
}
353353

354354
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
356356
// klog.Infof("POD CREATING: [%s/%s/%s/%s/%+v/%s]", string(podObj.GetUID()), podObj.Namespace,
357357
// podObj.Name, podObj.Spec.NodeName, podObj.Labels, podObj.Status.PodIP)
358358

@@ -375,7 +375,7 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
375375
namespaceSet := []*ipsets.IPSetMetadata{ipsets.NewIPSetMetadata(podObj.Namespace, ipsets.Namespace)}
376376

377377
// 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
379379
// klog.Infof("Adding pod %s (ip : %s) to ipset %s", podKey, podObj.Status.PodIP, podObj.Namespace)
380380
if err = c.dp.AddToSets(namespaceSet, podMetadata); err != nil {
381381
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 {
394394
targetSetKeyValue := ipsets.NewIPSetMetadata(labelKeyValue, ipsets.KeyValueLabelOfPod)
395395
allSets := []*ipsets.IPSetMetadata{targetSetKey, targetSetKeyValue}
396396

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
398398
// klog.Infof("Creating ipsets %+v and %+v if they do not exist", targetSetKey, targetSetKeyValue)
399399
// klog.Infof("Adding pod %s (ip : %s) to ipset %s and %s", podKey, npmPodObj.PodIP, labelKey, labelKeyValue)
400400
if err = c.dp.AddToSets(allSets, podMetadata); err != nil {
@@ -404,7 +404,7 @@ func (c *PodController) syncAddedPod(podObj *corev1.Pod) error {
404404
}
405405

406406
// 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
408408
// klog.Infof("Adding named port ipsets")
409409
containerPorts := common.GetContainerPortList(podObj)
410410
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
439439
c.npmNamespaceCache.Unlock()
440440

441441
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
443443
// klog.Infof("[syncAddAndUpdatePod] updating Pod with key %s", podKey)
444444
// No cached npmPod exists. start adding the pod in a cache
445445
if !exists {
@@ -456,17 +456,17 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
456456
// NPM should clean up existing references of cached pod obj and its IP.
457457
// then, re-add new pod obj.
458458
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
460460
// klog.Infof("Pod (Namespace:%s, Name:%s, newUid:%s), has cachedPodIp:%s which is different from PodIp:%s",
461461
// newPodObj.Namespace, newPodObj.Name, string(newPodObj.UID), cachedNpmPod.PodIP, newPodObj.Status.PodIP)
462462

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
464464
// klog.Infof("Deleting cached Pod with key:%s first due to IP Mistmatch", podKey)
465465
if er := c.cleanUpDeletedPod(podKey); er != nil {
466466
return metrics.UpdateOp, er
467467
}
468468

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
470470
// klog.Infof("Adding back Pod with key:%s after IP Mistmatch", podKey)
471471
return metrics.UpdateOp, c.syncAddedPod(newPodObj)
472472
}
@@ -481,7 +481,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
481481
cachedPodMetadata := dataplane.NewPodMetadata(podKey, cachedNpmPod.PodIP, newPodMetadata.NodeName)
482482
// Delete the pod from its label's ipset.
483483
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
485485
// klog.Infof("Deleting pod %s (ip : %s) from ipset %s", podKey, cachedNpmPod.PodIP, removeIPSetName)
486486

487487
var toRemoveSet *ipsets.IPSetMetadata
@@ -504,7 +504,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
504504
// Add the pod to its label's ipset.
505505
for _, addIPSetName := range addToIPSets {
506506

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
508508
// klog.Infof("Creating ipset %s if it doesn't already exist", addIPSetName)
509509

510510
var toAddSet *ipsets.IPSetMetadata
@@ -514,7 +514,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
514514
toAddSet = ipsets.NewIPSetMetadata(addIPSetName, ipsets.KeyLabelOfPod)
515515
}
516516

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
518518
// klog.Infof("Adding pod %s (ip : %s) to ipset %s", podKey, newPodObj.Status.PodIP, addIPSetName)
519519
if err = c.dp.AddToSets([]*ipsets.IPSetMetadata{toAddSet}, newPodMetadata); err != nil {
520520
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
558558

559559
// cleanUpDeletedPod cleans up all ipset associated with this pod
560560
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
562562
// klog.Infof("[cleanUpDeletedPod] deleting Pod with key %s", cachedNpmPodKey)
563563
// If cached npmPod does not exist, return nil
564564
cachedNpmPod, exist := c.podMap[cachedNpmPodKey]
@@ -579,7 +579,7 @@ func (c *PodController) cleanUpDeletedPod(cachedNpmPodKey string) error {
579579
// Get lists of podLabelKey and podLabelKey + podLavelValue ,and then start deleting them from ipsets
580580
for labelKey, labelVal := range cachedNpmPod.Labels {
581581
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
583583
// klog.Infof("Deleting pod %s (ip : %s) from ipsets %s and %s", cachedNpmPodKey, cachedNpmPod.PodIP, labelKey, labelKeyValue)
584584
if err = c.dp.RemoveFromSets(
585585
[]*ipsets.IPSetMetadata{
@@ -613,7 +613,7 @@ func (c *PodController) manageNamedPortIpsets(portList []corev1.ContainerPort, p
613613
return nil
614614
}
615615
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
617617
// klog.Infof("port is %+v", port)
618618
if port.Name == "" {
619619
continue

0 commit comments

Comments
 (0)