@@ -50,21 +50,21 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
50
50
defer cancel ()
51
51
// This test uses `egress-sctp` ANP
52
52
// harry-potter-0 is our server pod in gryffindor namespace
53
- clientPod := & v1.Pod {}
53
+ serverPod := & v1.Pod {}
54
54
err := s .Client .Get (ctx , client.ObjectKey {
55
55
Namespace : "network-policy-conformance-gryffindor" ,
56
56
Name : "harry-potter-0" ,
57
- }, clientPod )
57
+ }, serverPod )
58
58
framework .ExpectNoError (err , "unable to fetch the server pod" )
59
59
// luna-lovegood-0 is our client pod in ravenclaw namespace
60
60
// ensure egress is ALLOWED to gryffindor from ravenclaw
61
61
// egressRule at index0 will take precedence over egressRule at index1; thus ALLOW takes precedence over DENY since rules are ordered
62
62
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
63
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
63
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
64
64
assert .Equal (t , true , success )
65
65
// luna-lovegood-1 is our client pod in ravenclaw namespace
66
66
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
67
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
67
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
68
68
assert .Equal (t , true , success )
69
69
})
70
70
@@ -73,21 +73,21 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
73
73
defer cancel ()
74
74
// This test uses `egress-sctp` ANP
75
75
// cedric-diggory-1 is our server pod in hufflepuff namespace
76
- clientPod := & v1.Pod {}
76
+ serverPod := & v1.Pod {}
77
77
err := s .Client .Get (ctx , client.ObjectKey {
78
78
Namespace : "network-policy-conformance-hufflepuff" ,
79
79
Name : "cedric-diggory-1" ,
80
- }, clientPod )
80
+ }, serverPod )
81
81
framework .ExpectNoError (err , "unable to fetch the server pod" )
82
82
// luna-lovegood-0 is our client pod in ravenclaw namespace
83
- // ensure egress is ALLOWED to hufflepuff from ravenclaw at port 9003; egressRule at index5
83
+ // ensure egress is ALLOWED to hufflepuff from ravenclaw at port 9003; egressRule at index5 should take effect
84
84
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
85
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
85
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
86
86
assert .Equal (t , true , success )
87
87
// luna-lovegood-1 is our client pod in ravenclaw namespace
88
- // ensure egress is DENIED to hufflepuff from ravenclaw for rest of the traffic; egressRule at index6
88
+ // ensure egress is DENIED to hufflepuff from ravenclaw for rest of the traffic; egressRule at index6 should take effect
89
89
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
90
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , false )
90
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , false )
91
91
assert .Equal (t , true , success )
92
92
})
93
93
@@ -96,11 +96,11 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
96
96
defer cancel ()
97
97
// This test uses `egress-sctp` ANP
98
98
// harry-potter-0 is our server pod in gryffindor namespace
99
- clientPod := & v1.Pod {}
99
+ serverPod := & v1.Pod {}
100
100
err := s .Client .Get (ctx , client.ObjectKey {
101
101
Namespace : "network-policy-conformance-gryffindor" ,
102
102
Name : "harry-potter-1" ,
103
- }, clientPod )
103
+ }, serverPod )
104
104
framework .ExpectNoError (err , "unable to fetch the server pod" )
105
105
anp := & v1alpha1.AdminNetworkPolicy {}
106
106
err = s .Client .Get (ctx , client.ObjectKey {
@@ -117,11 +117,11 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
117
117
// ensure egress is DENIED to gryffindor from ravenclaw
118
118
// egressRule at index0 will take precedence over egressRule at index1; thus DENY takes precedence over ALLOW since rules are ordered
119
119
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
120
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , false )
120
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , false )
121
121
assert .Equal (t , true , success )
122
122
// luna-lovegood-1 is our client pod in ravenclaw namespace
123
123
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
124
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , false )
124
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , false )
125
125
assert .Equal (t , true , success )
126
126
})
127
127
@@ -130,21 +130,21 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
130
130
defer cancel ()
131
131
// This test uses `egress-sctp` ANP
132
132
// draco-malfoy-0 is our server pod in slytherin namespace
133
- clientPod := & v1.Pod {}
133
+ serverPod := & v1.Pod {}
134
134
err := s .Client .Get (ctx , client.ObjectKey {
135
135
Namespace : "network-policy-conformance-slytherin" ,
136
136
Name : "draco-malfoy-0" ,
137
- }, clientPod )
137
+ }, serverPod )
138
138
framework .ExpectNoError (err , "unable to fetch the server pod" )
139
139
// luna-lovegood-0 is our client pod in ravenclaw namespace
140
- // ensure egress to slytherin is DENIED from ravenclaw at port 9003; egressRule at index3
140
+ // ensure egress to slytherin is DENIED from ravenclaw at port 9003; egressRule at index3 should take effect
141
141
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
142
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , false )
142
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , false )
143
143
assert .Equal (t , true , success )
144
144
// luna-lovegood-1 is our client pod in ravenclaw namespace
145
145
// ensure egress to slytherin is ALLOWED from ravenclaw for rest of the traffic; matches no rules hence allowed
146
146
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
147
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
147
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
148
148
assert .Equal (t , true , success )
149
149
})
150
150
@@ -153,11 +153,11 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
153
153
defer cancel ()
154
154
// This test uses `egress-sctp` ANP
155
155
// harry-potter-0 is our server pod in gryffindor namespace
156
- clientPod := & v1.Pod {}
156
+ serverPod := & v1.Pod {}
157
157
err := s .Client .Get (ctx , client.ObjectKey {
158
158
Namespace : "network-policy-conformance-gryffindor" ,
159
159
Name : "harry-potter-1" ,
160
- }, clientPod )
160
+ }, serverPod )
161
161
framework .ExpectNoError (err , "unable to fetch the server pod" )
162
162
anp := & v1alpha1.AdminNetworkPolicy {}
163
163
err = s .Client .Get (ctx , client.ObjectKey {
@@ -174,11 +174,11 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
174
174
// ensure egress is PASSED from gryffindor to ravenclaw
175
175
// egressRule at index0 will take precedence over egressRule at index1&index2; thus PASS takes precedence over ALLOW/DENY since rules are ordered
176
176
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
177
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
177
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
178
178
assert .Equal (t , true , success )
179
179
// luna-lovegood-1 is our client pod in ravenclaw namespace
180
180
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
181
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
181
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
182
182
assert .Equal (t , true , success )
183
183
})
184
184
@@ -187,11 +187,11 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
187
187
defer cancel ()
188
188
// This test uses `egress-sctp` ANP
189
189
// draco-malfoy-0 is our server pod in slytherin namespace
190
- clientPod := & v1.Pod {}
190
+ serverPod := & v1.Pod {}
191
191
err := s .Client .Get (ctx , client.ObjectKey {
192
192
Namespace : "network-policy-conformance-slytherin" ,
193
193
Name : "draco-malfoy-0" ,
194
- }, clientPod )
194
+ }, serverPod )
195
195
framework .ExpectNoError (err , "unable to fetch the server pod" )
196
196
anp := & v1alpha1.AdminNetworkPolicy {}
197
197
err = s .Client .Get (ctx , client.ObjectKey {
@@ -205,14 +205,14 @@ var AdminNetworkPolicyEgressSCTP = suite.ConformanceTest{
205
205
err = s .Client .Update (ctx , anp )
206
206
framework .ExpectNoError (err , "unable to update the admin network policy" )
207
207
// luna-lovegood-0 is our client pod in ravenclaw namespace
208
- // ensure egress to slytherin is PASSED from ravenclaw at port 9003; egressRule at index3
208
+ // ensure egress to slytherin is PASSED from ravenclaw at port 9003; egressRule at index3 should take effect
209
209
success := kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-0" , "sctp" ,
210
- clientPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
210
+ serverPod .Status .PodIP , int32 (9003 ), s .TimeoutConfig .RequestTimeout , true )
211
211
assert .Equal (t , true , success )
212
212
// luna-lovegood-1 is our client pod in ravenclaw namespace
213
213
// ensure egress to slytherin is ALLOWED from ravenclaw for rest of the traffic; matches no rules hence allowed
214
214
success = kubernetes .PokeServer (t , "network-policy-conformance-ravenclaw" , "luna-lovegood-1" , "sctp" ,
215
- clientPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
215
+ serverPod .Status .PodIP , int32 (9005 ), s .TimeoutConfig .RequestTimeout , true )
216
216
assert .Equal (t , true , success )
217
217
})
218
218
},
0 commit comments