Validation of group
as a stand-alone selector is not comprehensive
#3084
Labels
kind/bug
Categorizes issue or PR as related to a bug.
Describe the bug
Within an ingress or egress rule,
group
cannot be used with any other selectors. But we only checked ifgroup
is used withpodSelector
,namespaceSelector
, andIPBlock
. So if users usegroup
with other selectors such asfqdn
, the policy will have unexpected behavior.https://github.com/antrea-io/antrea/blob/main/pkg/apis/crd/v1alpha1/types.go#L425-L429
https://github.com/antrea-io/antrea/blob/main/pkg/controller/networkpolicy/validate.go#L473
To Reproduce
Create an Antrea-native network policy like below:
Pods with label
app: client
still can access google.com.The text was updated successfully, but these errors were encountered: