Commit a655bd4
committed
Skip tests modifying cluster/network.config when it is not permitted
In HyperShift a ValidatingAdmissionPolicy blocks the tests from modifying cluster config
resources. Skip the tests that modify cluster/network.config.openshift.io if the admin client is not allowed to do so.
Note that the ValidatingAdmissionPolicy failures return an Invalid(422) and not Forbidden(403) error:
```
I0527 19:02:21.445832 2048333 request.go:1154] Request Body: {"spec":{"networkType": ""}}
I0527 19:02:21.445873 2048333 round_trippers.go:463] PATCH https://api.wveww-wjddj-6em.auu6.p3.openshiftapps.com:443/apis/config.openshift.io/v1/networks/cluster?dryRun=All&fieldManager=kubectl-patch
I0527 19:02:21.445878 2048333 round_trippers.go:469] Request Headers:
I0527 19:02:21.445886 2048333 round_trippers.go:473] Accept: application/json
I0527 19:02:21.445892 2048333 round_trippers.go:473] Content-Type: application/merge-patch+json
I0527 19:02:21.445897 2048333 round_trippers.go:473] User-Agent: oc/v4.2.0 (linux/amd64) kubernetes/5559085
I0527 19:02:21.445902 2048333 round_trippers.go:473] Authorization: Bearer <masked>
I0527 19:02:21.577807 2048333 round_trippers.go:574] Response Status: 422 Unprocessable Entity in 131 milliseconds
I0527 19:02:21.577830 2048333 round_trippers.go:577] Response Headers:
I0527 19:02:21.577836 2048333 round_trippers.go:580] Cache-Control: no-cache, private
I0527 19:02:21.577841 2048333 round_trippers.go:580] Content-Type: application/json
I0527 19:02:21.577847 2048333 round_trippers.go:580] Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
I0527 19:02:21.577852 2048333 round_trippers.go:580] X-Kubernetes-Pf-Flowschema-Uid: 6e3b2d16-aa1b-42a1-bf05-eb06efacf90c
I0527 19:02:21.577857 2048333 round_trippers.go:580] X-Kubernetes-Pf-Prioritylevel-Uid: 488a1e74-530c-4ca1-8d71-31360b7f84da
I0527 19:02:21.577863 2048333 round_trippers.go:580] Content-Length: 702
I0527 19:02:21.577868 2048333 round_trippers.go:580] Date: Tue, 27 May 2025 17:02:21 GMT
I0527 19:02:21.577874 2048333 round_trippers.go:580] Audit-Id: 0a1efc9d-4405-4c9a-bc6f-8563fd714f77
I0527 19:02:21.577903 2048333 request.go:1154] Response Body: {"kind":"Status","apiVersion":"v1","metadata":{},"status":"Failure","message":"networks.config.openshift.io \"cluster\" is forbidden: ValidatingAdmissionPolicy 'config' with binding 'config-binding' denied request: This resource cannot be created, updated, or deleted. Please ask your administrator to modify the resource in the HostedCluster object.","reason":"Invalid","details":{"name":"cluster","group":"config.openshift.io","kind":"networks","causes":[{"message":"ValidatingAdmissionPolicy 'config' with binding 'config-binding' denied request: This resource cannot be created, updated, or deleted. Please ask your administrator to modify the resource in the HostedCluster object."}]},"code":422}
The networks "cluster" is invalid: : ValidatingAdmissionPolicy 'config' with binding 'config-binding' denied request: This resource cannot be created, updated, or deleted. Please ask your administrator to modify the resource in the HostedCluster object.
```
Signed-off-by: Patryk Diak <[email protected]>1 parent d30b7e1 commit a655bd4
File tree
3 files changed
+45
-3
lines changed- test/extended/networking
3 files changed
+45
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| 19 | + | |
19 | 20 | | |
20 | 21 | | |
21 | 22 | | |
| |||
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
34 | 42 | | |
35 | 43 | | |
36 | | - | |
| 44 | + | |
37 | 45 | | |
38 | 46 | | |
39 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
92 | 100 | | |
93 | 101 | | |
94 | 102 | | |
| |||
97 | 105 | | |
98 | 106 | | |
99 | 107 | | |
100 | | - | |
| 108 | + | |
101 | 109 | | |
102 | 110 | | |
103 | 111 | | |
| |||
166 | 174 | | |
167 | 175 | | |
168 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
169 | 184 | | |
170 | 185 | | |
171 | 186 | | |
| |||
175 | 190 | | |
176 | 191 | | |
177 | 192 | | |
178 | | - | |
| 193 | + | |
179 | 194 | | |
180 | 195 | | |
181 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
32 | 33 | | |
33 | 34 | | |
34 | 35 | | |
| |||
976 | 977 | | |
977 | 978 | | |
978 | 979 | | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
0 commit comments