Skip to content

Commit

Permalink
Merge pull request #850 from noironetworks/revert
Browse files Browse the repository at this point in the history
Revert "Add locks to secure SNAT go routines in hostagent"
  • Loading branch information
snaiksat committed Aug 12, 2021
2 parents 9bdf822 + 7915021 commit da289d8
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions pkg/hostagent/pod_relatives.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,6 @@ func (agent *HostAgent) updatePodsForNamespace(ns string) {
func (agent *HostAgent) namespaceAdded(obj interface{}) {
ns := obj.(*v1.Namespace)
agent.log.Infof("Namespace %+v added", ns)
agent.indexMutex.Lock()
defer agent.indexMutex.Unlock()
agent.netPolPods.UpdateNamespace(ns)
agent.updatePodsForNamespace(ns.ObjectMeta.Name)
agent.handleObjectUpdateForSnat(obj)
Expand All @@ -94,9 +92,7 @@ func (agent *HostAgent) namespaceChanged(oldobj interface{},

if !reflect.DeepEqual(oldns.ObjectMeta.Labels, newns.ObjectMeta.Labels) {
agent.netPolPods.UpdateNamespace(newns)
agent.indexMutex.Lock()
agent.handleObjectUpdateForSnat(newobj)
agent.indexMutex.Unlock()
}
if !reflect.DeepEqual(oldns.ObjectMeta.Annotations,
newns.ObjectMeta.Annotations) {
Expand Down Expand Up @@ -327,8 +323,6 @@ func deploymentLogger(log *logrus.Logger, dep *appsv1.Deployment) *logrus.Entry

func (agent *HostAgent) deploymentAdded(obj interface{}) {
agent.log.Infof("deploymentAdded => ")
agent.indexMutex.Lock()
defer agent.indexMutex.Unlock()
agent.depPods.UpdateSelectorObj(obj)
agent.handleObjectUpdateForSnat(obj)
}
Expand Down Expand Up @@ -359,9 +353,7 @@ func (agent *HostAgent) deploymentChanged(oldobj interface{},
}
if !reflect.DeepEqual(olddep.ObjectMeta.Labels,
newdep.ObjectMeta.Labels) {
agent.indexMutex.Lock()
agent.handleObjectUpdateForSnat(newdep)
agent.indexMutex.Unlock()
}
}

Expand Down

0 comments on commit da289d8

Please sign in to comment.