Hide Forgot
Description of problem: When we create an EgressNetworkPolicy resource with `oc apply` and try to update the same with 'oc apply' it gives an error as below. ~~~ Error from server (UnsupportedMediaType): 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 ~~~ Version-Release number of selected component (if applicable): OCP - 4.8 How reproducible: Every time Steps to Reproduce: 1. Create an `EgressNetworkPolicy` resource (oc apply -f <yaml>) 2. update the newly created resource`EgressNetworkPolicy` resource (oc apply -f <yaml>) 3. While updating it should give an error Actual results: `EgressNetworkPolicy` resource is not updating Expected results: `EgressNetworkPolicy` resource should update with any issue Additional info: we are able to update the resource with oc replace -f <yaml>
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