diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index 658f9fbce..e1d118249 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -1033,9 +1033,8 @@ func (c *Cluster) processPodEvent(obj interface{}) error { } c.podSubscribersMu.RLock() - defer c.podSubscribersMu.RUnlock() - subscriber, ok := c.podSubscribers[spec.NamespacedName(event.PodName)] + c.podSubscribersMu.RUnlock() if ok { subscriber <- event } diff --git a/pkg/util/util.go b/pkg/util/util.go index 63b24ca33..8e27e4448 100644 --- a/pkg/util/util.go +++ b/pkg/util/util.go @@ -324,7 +324,7 @@ func testNil(values ...*int32) bool { return false } -// ToIntStr convert int to IntOrString type +// ToIntStr converts int to IntOrString type func ToIntStr(val int) *intstr.IntOrString { b := intstr.FromInt(val) return &b