Skip to content

Commit 6a2eda5

Browse files
committed
resolved comments
1 parent 13501a7 commit 6a2eda5

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

npm/pkg/dataplane/dataplane.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ func NewDataPlane(nodeName string, ioShim *common.IOShim, cfg *Config, stopChann
105105
// do not let Linux apply in background
106106
dp.applyInBackground = cfg.ApplyInBackground && util.IsWindowsDP()
107107
if dp.applyInBackground {
108+
klog.Infof("[DataPlane] dataplane configured to apply in background every %v or every %d calls to ApplyDataPlane()", dp.ApplyInterval, dp.ApplyMaxBatches)
108109
dp.updatePodCache = newUpdatePodCache(cfg.ApplyMaxBatches)
109110
if dp.ApplyMaxBatches <= 0 || dp.ApplyInterval == 0 {
110111
return nil, ErrInvalidApplyConfig
@@ -416,6 +417,7 @@ func (dp *DataPlane) addPoliciesWithRetry(context string) {
416417
return
417418
}
418419

420+
klog.Errorf("[DataPlane] [%s] failed to add policies. will retry one policy at a time. err: %s", context, err.Error())
419421
metrics.SendErrorLogAndMetric(util.DaemonDataplaneID, "[DataPlane] [%s] failed to add policies. err: %s", context, err.Error())
420422

421423
// retry one policy at a time
@@ -476,6 +478,7 @@ func (dp *DataPlane) addPolicies(netPols []*policies.NPMNetworkPolicy) error {
476478
// Create and add references for Selector IPSets first
477479
err := dp.createIPSetsAndReferences(netPol.AllPodSelectorIPSets(), netPol.PolicyKey, ipsets.SelectorType)
478480
if err != nil {
481+
klog.Infof("[DataPlane] error while adding Selector IPSet references: %s", err.Error())
479482
return fmt.Errorf("[DataPlane] error while adding Selector IPSet references: %w", err)
480483
}
481484

npm/pkg/dataplane/types.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import (
77
"github.com/Azure/azure-container-networking/npm/pkg/dataplane/ipsets"
88
"github.com/Azure/azure-container-networking/npm/pkg/dataplane/policies"
99
"github.com/Azure/azure-container-networking/npm/util"
10+
"k8s.io/klog"
1011
)
1112

1213
type GenericDataplane interface {
@@ -123,6 +124,7 @@ func (c *updatePodCache) enqueue(m *PodMetadata) *updateNPMPod {
123124
// Currently, don't expect this path to be taken because dataplane makes sure to only enqueue on-node Pods.
124125
// If the pod is already in the cache but the node name has changed, we need to requeue it.
125126
// Can discard the old Pod info since the Pod must have been deleted and brought back up on a different node.
127+
klog.Infof("[DataPlane] pod already in cache but node name has changed. deleting the old pod object from the queue. podKey: %s", m.PodKey)
126128

127129
// remove the old pod from the cache and queue
128130
delete(c.cache, m.PodKey)

0 commit comments

Comments
 (0)