Uploaded image for project: 'OpenShift Bugs'
  1. OpenShift Bugs
  2. OCPBUGS-3796

Unable to retrieve pod event count

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not a Bug
    • Icon: Minor Minor
    • None
    • 4.12.0
    • kube-scheduler
    • None
    • Important
    • None
    • Rejected
    • False
    • Hide

      None

      Show
      None

      Description of problem:

      When retrieving the event count for pod events (such as the FailedScheduling event), the count is set to 0 and never incremented. This occurs whether the event is retrieved as a k8s.io/api/events/v1 resource (the new Kubernetes events API) or as a k8s.io/api/core/v1 event resource. The Kubernetes API Migration guide (https://kubernetes.io/docs/reference/using-api/deprecation-guide/#event-v125), instructs to use event.series.count instead of event.count, however in my testing, event.series is uninitialized/nil, so it can't be consulted to retrieve the event count.
      
      This behaviour (having the event count set to 0 and not being incremented) differs from the behaviour of Minikube v1.27.1 with Kubernetes v1.25.2, where the event count starts at 1 and is subsequently incremented. 
      
      What is the suggested way of retrieving the number of times (count) that an event has occurred on OpenShift?
      
      

      Version-Release number of selected component (if applicable):

      4.10 (though not consistently), 4.11, 4.12

      How reproducible:

      This issue doesn't seem to happen consistently on OpenShift 4.10 though I am not sure why yet. It occurs consistently on OpenShift 4.11 and 4.12

      Steps to Reproduce:

      I have made a small issue reproducer application in Go.
      The application will make a deployment to the cluster that requests a high amount of memory that is intended to cause a FailedScheduling event.
      The application then lists out the pod events for the deployment and checks the event.count field as well as whether event.series is initialized or not. 
      When the application is closed with a ctrl+C, the deployment will be deleted from the cluster.
      
      1. Log into an OpenShift 4.11 or 4.12 cluster
      2. Git clone the issue reproducer repository: https://github.com/AObuchow/openshift-event-count-issue-reproducer
      3. Within the issue reproducer repository, do a `go get` followed by `go run .`
      4. The application will output the event.count of pod events and as well as whether event.series is initialized or not

      Actual results:

      The event.count field is set to 0 and never incremented, despite the fact that a `oc describe pod <pod-name>` will display 2 FailedScheduling events for the pod. Furthermore, event.series will be set to nil and thus event.series.count cannot be read. 

      Expected results:

      Either event.count is initially set to 1 and incremented as the event occurs again, or event.series is initialized and event.series.count is set to 1 and incremented as the event occurs repeatedly. 

      Additional info:

      I noticed that 2 separate FailedScheduling events occur in my issue reproducer, and they are not aggregated together - perhaps there is an issue somewhere in aggregating related events?
      
      This bug was initially reported here: https://github.com/devfile/devworkspace-operator/issues/977

              rh-ee-lseveroa Lucas Severo Alves (Inactive)
              aobuchow Andrew Obuchowicz
              Rama Kasturi Narra Rama Kasturi Narra
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: