Skip to content

Commit 449c2af

Browse files
committed
test
1 parent 394dd0b commit 449c2af

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

npm/pkg/dataplane/dataplane_linux_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,6 @@ 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)
9997
metrics.ReinitializeAll()
10098

10199
calls := getBootupTestCalls()

npm/pkg/dataplane/types.go

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

146146
if !ok {
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)
147+
klog.Infof("[DataPlane] pod key %s not found in updatePodCache. creating a new obj", m.PodKey)
149148

150149
pod = newUpdateNPMPod(m)
151150
c.cache[m.PodKey] = pod
@@ -158,8 +157,7 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod {
158157
// dequeue returns the first pod in the queue and removes it from the queue.
159158
func (c *updatePodCache) dequeue() *updateNPMPod {
160159
if c.isEmpty() {
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()")
160+
klog.Infof("[DataPlane] updatePodCache is empty. returning nil for dequeue()")
163161
return nil
164162
}
165163

@@ -179,8 +177,7 @@ func (c *updatePodCache) dequeue() *updateNPMPod {
179177
func (c *updatePodCache) requeue(pod *updateNPMPod) {
180178
if _, ok := c.cache[pod.PodKey]; ok {
181179
// should not happen
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)
180+
klog.Infof("[DataPlane] pod key %s already exists in updatePodCache. skipping requeue", pod.PodKey)
184181
return
185182
}
186183

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

212209
// enqueue adds a NetPol to the queue. If the NetPol already exists in the queue, the NetPol object is updated.
213210
func (q *netPolQueue) enqueue(policy *policies.NPMNetworkPolicy) {
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-
// }
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+
}
220216
q.toAdd[policy.PolicyKey] = policy
221217
}
222218

0 commit comments

Comments
 (0)