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 28, 2020
1 parent 2ca0487 commit 79a2a24
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 146 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
2 changes: 1 addition & 1 deletion pkg/controller/networkpolicy/clusternetworkpolicy_test.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2019 Antrea Authors
// Copyright 2020 Antrea Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
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 79a2a24

Please sign in to comment.