Skip to content

Commit

Permalink
Unify functions for Pod and ExternalEntity in networkpolicy controller
Browse files Browse the repository at this point in the history
  • Loading branch information
Dyanngg committed Aug 26, 2020
1 parent 14109aa commit 0f1e8fb
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 145 deletions.
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ require (
github.com/gogo/protobuf v1.3.1
github.com/golang/mock v1.4.3
github.com/golang/protobuf v1.3.2
github.com/google/go-cmp v0.4.0
github.com/google/uuid v1.1.1
github.com/kevinburke/ssh_config v0.0.0-20190725054713-01f96b0aa0cd
github.com/pkg/errors v0.9.1
Expand Down
4 changes: 2 additions & 2 deletions pkg/controller/networkpolicy/endpoint_querier.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ func (eq *endpointQuerier) QueryNetworkPolicies(namespace string, podName string
ingress := make([]*ruleTemp, 0)
egress := make([]*ruleTemp, 0)
// get all appliedToGroups using filter, then get applied policies using appliedToGroup
appliedToGroupKeys := eq.networkPolicyController.filterAppliedToGroupsForPod(pod)
appliedToGroupKeys := eq.networkPolicyController.filterAppliedToGroupsForPodOrExternalEntity(pod)
if err != nil {
return nil, err
}
Expand All @@ -118,7 +118,7 @@ func (eq *endpointQuerier) QueryNetworkPolicies(namespace string, podName string
}
}
// get all addressGroups using filter, then get ingress and egress policies using addressGroup
addressGroupKeys := eq.networkPolicyController.filterAddressGroupsForPod(pod)
addressGroupKeys := eq.networkPolicyController.filterAddressGroupsForPodOrExternalEntity(pod)
if err != nil {
return nil, err
}
Expand Down
Loading

0 comments on commit 0f1e8fb

Please sign in to comment.