Skip to content

Commit

Permalink
avoid using getter functions for k8s namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhamavi committed Mar 3, 2021
1 parent 7d9dc3b commit 50bdb37
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/agent/nodeportlocal/k8s/npl_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ func (c *NPLController) isNPLEnabledForServiceOfPod(obj interface{}) bool {
svc, isSvc := service.(*corev1.Service)
// Selecting Services NOT of type NodePort, with Service selector matching Pod labels.
if isSvc && svc.Spec.Type != corev1.ServiceTypeNodePort {
if pod.GetNamespace() == svc.GetNamespace() &&
if pod.Namespace == svc.Namespace &&
matchSvcSelectorPodLabels(svc.Spec.Selector, pod.GetLabels()) {
return true
}
Expand Down

0 comments on commit 50bdb37

Please sign in to comment.