Skip to content

Commit a69d632

Browse files
committed
Revert "test"
This reverts commit 449c2af.
1 parent 449c2af commit a69d632

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

npm/pkg/dataplane/dataplane_linux_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@ func TestNetPolInBackgroundUpdatePolicy(t *testing.T) {
9494
}
9595

9696
func TestNetPolInBackgroundSkipAddAfterRemove(t *testing.T) {
97+
// Sleep for a bit to let IncNumACLRulesBy be resolved to avoid race condition
98+
time.Sleep(100 * time.Millisecond)
9799
metrics.ReinitializeAll()
98100

99101
calls := getBootupTestCalls()

npm/pkg/dataplane/types.go

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,8 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod {
144144
}
145145

146146
if !ok {
147-
klog.Infof("[DataPlane] pod key %s not found in updatePodCache. creating a new obj", m.PodKey)
147+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
148+
// klog.Infof("[DataPlane] pod key %s not found in updatePodCache. creating a new obj", m.PodKey)
148149

149150
pod = newUpdateNPMPod(m)
150151
c.cache[m.PodKey] = pod
@@ -157,7 +158,8 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod {
157158
// dequeue returns the first pod in the queue and removes it from the queue.
158159
func (c *updatePodCache) dequeue() *updateNPMPod {
159160
if c.isEmpty() {
160-
klog.Infof("[DataPlane] updatePodCache is empty. returning nil for dequeue()")
161+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
162+
// klog.Infof("[DataPlane] updatePodCache is empty. returning nil for dequeue()")
161163
return nil
162164
}
163165

@@ -177,7 +179,8 @@ func (c *updatePodCache) dequeue() *updateNPMPod {
177179
func (c *updatePodCache) requeue(pod *updateNPMPod) {
178180
if _, ok := c.cache[pod.PodKey]; ok {
179181
// should not happen
180-
klog.Infof("[DataPlane] pod key %s already exists in updatePodCache. skipping requeue", pod.PodKey)
182+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
183+
// klog.Infof("[DataPlane] pod key %s already exists in updatePodCache. skipping requeue", pod.PodKey)
181184
return
182185
}
183186

@@ -208,11 +211,12 @@ func (q *netPolQueue) len() int {
208211

209212
// enqueue adds a NetPol to the queue. If the NetPol already exists in the queue, the NetPol object is updated.
210213
func (q *netPolQueue) enqueue(policy *policies.NPMNetworkPolicy) {
211-
if _, ok := q.toAdd[policy.PolicyKey]; ok {
212-
klog.Infof("[DataPlane] policy %s exists in netPolQueue. updating", policy.PolicyKey)
213-
} else {
214-
klog.Infof("[DataPlane] enqueuing policy %s in netPolQueue", policy.PolicyKey)
215-
}
214+
// TODO: Refactor non-error/warning klogs with Zap and set the following logs to "debug" level
215+
// if _, ok := q.toAdd[policy.PolicyKey]; ok {
216+
// klog.Infof("[DataPlane] policy %s exists in netPolQueue. updating", policy.PolicyKey)
217+
// } else {
218+
// klog.Infof("[DataPlane] enqueuing policy %s in netPolQueue", policy.PolicyKey)
219+
// }
216220
q.toAdd[policy.PolicyKey] = policy
217221
}
218222

0 commit comments

Comments
 (0)