Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions npm/pkg/controlplane/controllers/v2/namespaceController.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,16 +124,13 @@ func (nsc *NamespaceController) needSync(obj interface{}, event string) (string,
return key, needSync
}

klog.Infof("[NAMESPACE %s EVENT] for namespace [%s]", event, key)

needSync = true
return key, needSync
}

func (nsc *NamespaceController) addNamespace(obj interface{}) {
key, needSync := nsc.needSync(obj, "ADD")
if !needSync {
klog.Infof("[NAMESPACE ADD EVENT] No need to sync this namespace [%s]", key)
return
}
nsc.workqueue.Add(key)
Expand All @@ -142,15 +139,13 @@ func (nsc *NamespaceController) addNamespace(obj interface{}) {
func (nsc *NamespaceController) updateNamespace(old, newns interface{}) {
key, needSync := nsc.needSync(newns, "UPDATE")
if !needSync {
klog.Infof("[NAMESPACE UPDATE EVENT] No need to sync this namespace [%s]", key)
return
}

nsObj, _ := newns.(*corev1.Namespace)
oldNsObj, ok := old.(*corev1.Namespace)
if ok {
if oldNsObj.ResourceVersion == nsObj.ResourceVersion {
klog.Infof("[NAMESPACE UPDATE EVENT] Resourceversion is same for this namespace [%s]", key)
return
}
}
Expand Down
7 changes: 0 additions & 7 deletions npm/pkg/controlplane/controllers/v2/podController.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,15 +151,11 @@ func (c *PodController) needSync(eventType string, obj interface{}) (string, boo
return key, needSync
}

klog.Infof("[POD %s EVENT] for %s in %s", eventType, podObj.Name, podObj.Namespace)

if !hasValidPodIP(podObj) {
return key, needSync
}

if isHostNetworkPod(podObj) {
klog.Infof("[POD %s EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]",
eventType, podObj.GetObjectMeta().GetUID(), podObj.Namespace, podObj.Name, podObj.Labels, podObj.Status.PodIP)
return key, needSync
}

Expand Down Expand Up @@ -194,7 +190,6 @@ func (c *PodController) addPod(obj interface{}) {
func (c *PodController) updatePod(old, newp interface{}) {
key, needSync := c.needSync("UPDATE", newp)
if !needSync {
klog.Infof("[POD UPDATE EVENT] No need to sync this pod")
return
}

Expand All @@ -205,7 +200,6 @@ func (c *PodController) updatePod(old, newp interface{}) {
if oldPod.ResourceVersion == newPod.ResourceVersion {
// Periodic resync will send update events for all known pods.
// Two different versions of the same pods will always have different RVs.
klog.Infof("[POD UPDATE EVENT] Two pods have the same RVs")
return
}
}
Expand Down Expand Up @@ -234,7 +228,6 @@ func (c *PodController) deletePod(obj interface{}) {

klog.Infof("[POD DELETE EVENT] for %s in %s", podObj.Name, podObj.Namespace)
if isHostNetworkPod(podObj) {
klog.Infof("[POD DELETE EVENT] HostNetwork POD IGNORED: [%s/%s/%s/%+v%s]", podObj.UID, podObj.Namespace, podObj.Name, podObj.Labels, podObj.Status.PodIP)
return
}

Expand Down
6 changes: 5 additions & 1 deletion npm/pkg/dataplane/policies/chain-management_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -200,14 +200,18 @@ func (pMgr *PolicyManager) bootup(_ []string) error {
// - creates the jump rule from FORWARD chain to AZURE-NPM chain (if it does not exist) and makes sure it's after the jumps to KUBE-FORWARD & KUBE-SERVICES chains (if they exist).
// - cleans up stale policy chains. It can be forced to stop this process if reconcileManager.forceLock() is called.
func (pMgr *PolicyManager) reconcile() {
klog.Infof("repositioning azure chain jump rule")
if err := pMgr.positionAzureChainJumpRule(); err != nil {
klog.Errorf("failed to reconcile jump rule to Azure-NPM due to %s", err.Error())
}

pMgr.reconcileManager.Lock()
defer pMgr.reconcileManager.Unlock()
staleChains := pMgr.staleChains.emptyAndGetAll()

if len(staleChains) == 0 {
return
}

klog.Infof("cleaning up these stale chains: %+v", staleChains)
if err := pMgr.cleanupChains(staleChains); err != nil {
klog.Errorf("failed to clean up old policy chains with the following error: %s", err.Error())
Expand Down