Bug 2071614
| Summary: | Updating EgressNetworkPolicy rejecting with error UnsupportedMediaType | ||
|---|---|---|---|
| Product: | OpenShift Container Platform | Reporter: | aharchin |
| Component: | oc | Assignee: | Arda Guclu <aguclu> |
| oc sub component: | oc | QA Contact: | zhou ying <yinzhou> |
| Status: | CLOSED ERRATA | Docs Contact: | |
| Severity: | medium | ||
| Priority: | medium | CC: | aos-bugs, mfojtik, rauferna |
| Version: | 4.8 | ||
| Target Milestone: | --- | ||
| Target Release: | 4.11.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: |
Cause:
Users can not apply EgressNetworkPolicy resource types
Consequence:
Users can not use EgressNetworkPolicy in their clusters via oc CLI
Fix:
Users will be able to create/update/delete EgressNetworkPolicy resources.
Result:
|
Story Points: | --- |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-08-10 11:03:18 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
| Bug Depends On: | |||
| Bug Blocks: | 2080151 | ||
|
Description
aharchin
2022-04-04 11:14:04 UTC
reproduced with older version :
./oc apply -f /tmp/vv1.yaml
egressnetworkpolicy.network.openshift.io/default-egress-egressnetworkpolicy created
[root@localhost ~]# ./oc apply -f /tmp/vv2.yaml
Error from server (UnsupportedMediaType): error when applying patch:
{"metadata":{"annotations":{"kubectl.kubernetes.io/last-applied-configuration":"{\"apiVersion\":\"network.openshift.io/v1\",\"kind\":\"EgressNetworkPolicy\",\"metadata\":{\"annotations\":{},\"name\":\"default-egress-egressnetworkpolicy\",\"namespace\":\"zhouyt\"},\"spec\":{\"egress\":[{\"to\":{\"cidrSelector\":\"10.148.184.38/32\"},\"type\":\"Allow\"},{\"to\":{\"cidrSelector\":\"0.0.0.0/0\"},\"type\":\"Deny\"}]}}\n"}},"spec":{"egress":[{"to":{"cidrSelector":"10.148.184.38/32"},"type":"Allow"},{"to":{"cidrSelector":"0.0.0.0/0"},"type":"Deny"}]}}
to:
Resource: "network.openshift.io/v1, Resource=egressnetworkpolicies", GroupVersionKind: "network.openshift.io/v1, Kind=EgressNetworkPolicy"
Name: "default-egress-egressnetworkpolicy", Namespace: "zhouyt"
for: "/tmp/vv2.yaml": the body of the request was in an unknown format - accepted media types include: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml
[root@localhost ~]# ./oc version --client
Client Version: 4.11.0-0.nightly-2022-04-06-000911
but fixed with latest oc :
oc version --client
Client Version: 4.11.0-202204260818.p0.g5c77c00.assembly.stream-5c77c00
Kustomize Version: v4.5.4
oc apply -f /tmp/vv1.yaml
egressnetworkpolicy.network.openshift.io/default-egress-egressnetworkpolicy created
[root@localhost ~]# vi /tmp/vv2.yaml
[root@localhost ~]# oc apply -f /tmp/vv2.yaml
egressnetworkpolicy.network.openshift.io/default-egress-egressnetworkpolicy configured
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (Important: OpenShift Container Platform 4.11.0 bug fix and security update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHSA-2022:5069 |