mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Allow ingress from pods in all namespaces
This commit is contained in:
parent
a3a3d4ae14
commit
0fc096e3aa
@ -197,6 +197,19 @@ var _ = SIGDescribeCopy("Netpol [LinuxOnly]", func() {
|
|||||||
ValidateOrFail(k8s, model, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
ValidateOrFail(k8s, model, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
})
|
})
|
||||||
|
|
||||||
|
ginkgo.It("should enforce policy to allow ingress traffic from pods in all namespaces [Feature:NetworkPolicy]", func() {
|
||||||
|
nsX, _, _, model, k8s := getK8SModel(f)
|
||||||
|
|
||||||
|
emptyLabel := &metav1.LabelSelector{
|
||||||
|
MatchLabels: map[string]string{},
|
||||||
|
}
|
||||||
|
policy := GetAllowIngressByNamespace("allow-from-another-ns", map[string]string{"pod": "a"}, emptyLabel)
|
||||||
|
CreatePolicy(k8s, policy, nsX)
|
||||||
|
|
||||||
|
reachability := NewReachability(model.AllPods(), true)
|
||||||
|
ValidateOrFail(k8s, model, &TestCase{ToPort: 80, Protocol: v1.ProtocolTCP, Reachability: reachability})
|
||||||
|
})
|
||||||
|
|
||||||
ginkgo.It("should enforce policy to allow traffic only from a different namespace, based on NamespaceSelector [Feature:NetworkPolicy]", func() {
|
ginkgo.It("should enforce policy to allow traffic only from a different namespace, based on NamespaceSelector [Feature:NetworkPolicy]", func() {
|
||||||
nsX, nsY, nsZ, model, k8s := getK8SModel(f)
|
nsX, nsY, nsZ, model, k8s := getK8SModel(f)
|
||||||
allowedLabels := &metav1.LabelSelector{
|
allowedLabels := &metav1.LabelSelector{
|
||||||
|
Loading…
Reference in New Issue
Block a user