@@ -81,35 +81,13 @@ func TestNetworkPolicyCoder(t *testing.T) {
81
81
require .Contains (t , policy .Spec .PolicyTypes , networkingv1 .PolicyTypeIngress , "expected to restrict ingress" )
82
82
require .NotContains (t , policy .Spec .PolicyTypes , networkingv1 .PolicyTypeEgress , "expected all egress to be allowed" )
83
83
require .Empty (t , policy .Spec .Egress , "expected empty egress rules" )
84
- protocolTCP := corev1 .ProtocolTCP
85
84
86
85
podSelector := & metav1.LabelSelector {}
87
86
metav1 .AddLabelToSelector (podSelector , "app.kubernetes.io/instance" , "coder" )
88
87
metav1 .AddLabelToSelector (podSelector , "app.kubernetes.io/component" , "coderd" )
89
88
require .Equal (t , podSelector , & policy .Spec .PodSelector , "expected pod selectors to match" )
90
89
91
- expectedRules := []networkingv1.NetworkPolicyIngressRule {
92
- {
93
- From : []networkingv1.NetworkPolicyPeer {},
94
- Ports : []networkingv1.NetworkPolicyPort {
95
- {
96
- Protocol : & protocolTCP ,
97
- Port : & intstr.IntOrString {
98
- Type : intstr .Int ,
99
- IntVal : 8080 ,
100
- },
101
- },
102
- {
103
- Protocol : & protocolTCP ,
104
- Port : & intstr.IntOrString {
105
- Type : intstr .Int ,
106
- IntVal : 8443 ,
107
- },
108
- },
109
- },
110
- },
111
- }
112
- require .Equal (t , expectedRules , policy .Spec .Ingress , "expected ingress rules to match" )
90
+ require .Equal (t , []networkingv1.NetworkPolicyIngressRule {{}}, policy .Spec .Ingress , "expected ingress rules to match" )
113
91
}
114
92
115
93
policy , exist = FindNetworkPolicy (objs , "timescale" )
0 commit comments