Bug 1776495 - `oc edit clusterresourcequota` cannot work
Summary: `oc edit clusterresourcequota` cannot work
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: oc
Version: 4.2.z
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: ---
: 4.2.z
Assignee: Maciej Szulik
QA Contact: zhou ying
URL:
Whiteboard:
Depends On: 1776100 1776493
Blocks: 1776496
TreeView+ depends on / blocked
 
Reported: 2019-11-25 19:37 UTC by Maciej Szulik
Modified: 2020-01-22 10:47 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of: 1776493
: 1776496 (view as bug list)
Environment:
Last Closed: 2020-01-22 10:46:40 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Github openshift oc pull 184 'None' 'open' '[release-4.2] Bug 1776495: don''t install quota CRDs' 2019-12-02 16:46:42 UTC
Github openshift oc pull 214 None None None 2019-12-13 09:27:33 UTC
Red Hat Product Errata RHBA-2020:0107 None None None 2020-01-22 10:47:03 UTC

Description Maciej Szulik 2019-11-25 19:37:54 UTC
+++ This bug was initially created as a clone of Bug #1776493 +++

+++ This bug was initially created as a clone of Bug #1776100 +++

Description of problem:
`oc edit clusterresourcequota` cannot work

Version-Release number of selected component (if applicable):
oc version -o yaml
clientVersion:
  buildDate: "2019-11-22T12:21:19Z"
  gitCommit: 9d412f42b3e753fd78eacd2ea7417a42fc02318d
  gitVersion: v4.3.0
...
openshiftVersion: 4.3.0-0.nightly-2019-11-24-183610
serverVersion:
  buildDate: "2019-11-22T14:41:49Z"
  gitVersion: v1.16.2
...

How reproducible:
Always

Steps to Reproduce:
1. cat > clusterresourcequota.yaml << EOF
kind: ClusterResourceQuota
apiVersion: quota.openshift.io/v1
metadata:
  name: loadbalancer-quota
spec:
  selector:
    annotations: null
    labels:
      matchExpressions:
      - key: managed.openshift.io/service-lb-quota-exempt-test
        operator: Exists
  quota:
    hard:
      services.loadbalancers: 8
EOF

oc create -f clusterresourcequota.yaml

2. oc edit clusterresourcequota loadbalancer-quota # add below annotation, then save
...
metadata:
  annotations:
    test: test1234
...

Actual results:
2. It fails with:
error: clusterresourcequotas.quota.openshift.io "loadbalancer-quota" could not be patched: the body of the request was in an unknown format - accepted media types inc
lude: application/json-patch+json, application/merge-patch+json, application/apply-patch+yaml

Check more logs, found it uses below Content-Type:
oc edit --loglevel 7 clusterresourcequota loadbalancer-quota
...
PATCH https://...:6443/apis/quota.openshift.io/v1/clusterresourcequotas/loadbalancer-quota
Request Headers:
    Content-Type: application/strategic-merge-patch+json
...

Expected results:
2. Should succeed.

--- Additional comment from Maciej Szulik on 2019-11-25 20:23:44 CET ---

Comment 2 zhou ying 2020-01-14 07:47:57 UTC
Confirmed with latest oc client, can't reproduce now:

[root@dhcp-140-138 tmp]# oc version -o yaml 
clientVersion:
  buildDate: "2020-01-10T04:45:20Z"
  compiler: gc
  gitCommit: 7207690010f08f2ae526ee3300d4a18ea65997fe
  gitTreeState: clean
  gitVersion: v4.2.15
  goVersion: go1.12.8
  major: ""
  minor: ""
  platform: linux/amd64


[root@dhcp-140-138 tmp]# oc edit clusterresourcequota.quota.openshift.io/loadbalancer-quota      # add below annotation, then save
...
metadata:
  annotations:
    test: test1234
...

clusterresourcequota.quota.openshift.io/loadbalancer-quota edited
[root@dhcp-140-138 tmp]# oc get clusterresourcequota.quota.openshift.io/loadbalancer-quota -o yaml
apiVersion: quota.openshift.io/v1
kind: ClusterResourceQuota
metadata:
  annotations:
    test: test1234
  creationTimestamp: "2020-01-14T07:43:39Z"
  generation: 1
  name: loadbalancer-quota

Comment 4 errata-xmlrpc 2020-01-22 10:46:40 UTC
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, 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/RHBA-2020:0107


Note You need to log in before you can comment on or make changes to this bug.