Bug 1537789

Summary: oc get events -w doesn't work
Product: OpenShift Container Platform Reporter: Jeremy Eder <jeder>
Component: ocAssignee: Juan Vallejo <jvallejo>
Status: CLOSED ERRATA QA Contact: Xingxing Xia <xxia>
Severity: medium Docs Contact:
Priority: medium    
Version: 3.9.0CC: aos-bugs, deads, jeder, jokerman, mfojtik, mifiedle, mmccomas, xiaocwan, xtian
Target Milestone: ---   
Target Release: 3.10.0   
Hardware: All   
OS: Linux   
Whiteboard: aos-scalability-39
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-07-30 19:09:00 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:

Comment 5 Juan Vallejo 2018-02-07 21:16:41 UTC
Origin PR: https://github.com/openshift/origin/pull/18514
Upstream PR: https://github.com/kubernetes/kubernetes/pull/59506

The reason why this error was occurring was due to the large amount of events that were being generated. The general issue, however, applies to any resource whose quantity exceeds a given chunk-size (defaults to "500" for `oc get`).

When the total number of a requested resource exceeds the request's chunk-size, multiple requests end up being made to the same endpoint, with each request producing its own "Info" object. Although we are dealing with a single resource kind, `oc get --watch` produces an error as it associates more than one "Info" with more than one resource kind.

The proposed patch modifies the `oc get` command to only fail if more than one "Info" is returned AND at least one of the infos has different group-version-kind information.

This bug can be reproduced locally by creating some resources on a cluster, and running "oc get -w" with a small chunk size value:

```
$ oc get events -w --chunk-size=2
error: watch is only supported on individual resources and resource collections - 17 resources were found
```

Comment 6 Juan Vallejo 2018-02-12 15:39:34 UTC
Upstream PR [1] has merged. Waiting on Origin [2].

1. https://github.com/kubernetes/kubernetes/pull/59506
2. https://github.com/openshift/origin/pull/18514

Comment 7 XiaochuanWang 2018-02-22 02:40:00 UTC
$ oc get events -w [--chunk-size=2] does not reproduced on oc v3.9.0-0.47.0

Comment 9 errata-xmlrpc 2018-07-30 19:09:00 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-2018:1816