diff --git a/npm/pkg/dataplane/dataplane_linux_test.go b/npm/pkg/dataplane/dataplane_linux_test.go index ba0035721e..837a33445d 100644 --- a/npm/pkg/dataplane/dataplane_linux_test.go +++ b/npm/pkg/dataplane/dataplane_linux_test.go @@ -94,8 +94,6 @@ func TestNetPolInBackgroundUpdatePolicy(t *testing.T) { } func TestNetPolInBackgroundSkipAddAfterRemove(t *testing.T) { - // Sleep for a bit to let IncNumACLRulesBy be resolved to avoid race condition - time.Sleep(100 * time.Millisecond) metrics.ReinitializeAll() calls := getBootupTestCalls() diff --git a/npm/pkg/dataplane/types.go b/npm/pkg/dataplane/types.go index dd17c714dc..2b06c5c079 100644 --- a/npm/pkg/dataplane/types.go +++ b/npm/pkg/dataplane/types.go @@ -144,8 +144,7 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod { } if !ok { - // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level - // klog.Infof("[DataPlane] pod key %s not found in updatePodCache. creating a new obj", m.PodKey) + klog.Infof("[DataPlane] pod key %s not found in updatePodCache. creating a new obj", m.PodKey) pod = newUpdateNPMPod(m) c.cache[m.PodKey] = pod @@ -158,8 +157,7 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod { // dequeue returns the first pod in the queue and removes it from the queue. func (c *updatePodCache) dequeue() *updateNPMPod { if c.isEmpty() { - // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level - // klog.Infof("[DataPlane] updatePodCache is empty. returning nil for dequeue()") + klog.Infof("[DataPlane] updatePodCache is empty. returning nil for dequeue()") return nil } @@ -179,8 +177,7 @@ func (c *updatePodCache) dequeue() *updateNPMPod { func (c *updatePodCache) requeue(pod *updateNPMPod) { if _, ok := c.cache[pod.PodKey]; ok { // should not happen - // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level - // klog.Infof("[DataPlane] pod key %s already exists in updatePodCache. skipping requeue", pod.PodKey) + klog.Infof("[DataPlane] pod key %s already exists in updatePodCache. skipping requeue", pod.PodKey) return } @@ -211,12 +208,11 @@ func (q *netPolQueue) len() int { // enqueue adds a NetPol to the queue. If the NetPol already exists in the queue, the NetPol object is updated. func (q *netPolQueue) enqueue(policy *policies.NPMNetworkPolicy) { - // TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level - // if _, ok := q.toAdd[policy.PolicyKey]; ok { - // klog.Infof("[DataPlane] policy %s exists in netPolQueue. updating", policy.PolicyKey) - // } else { - // klog.Infof("[DataPlane] enqueuing policy %s in netPolQueue", policy.PolicyKey) - // } + if _, ok := q.toAdd[policy.PolicyKey]; ok { + klog.Infof("[DataPlane] policy %s exists in netPolQueue. updating", policy.PolicyKey) + } else { + klog.Infof("[DataPlane] enqueuing policy %s in netPolQueue", policy.PolicyKey) + } q.toAdd[policy.PolicyKey] = policy }