Skip to content

Informer example requires fix: infomer restarted after onerror event doesn't dispatch other events #795

Closed as not planned
@faxioman

Description

@faxioman

Describe the bug
The informer example shows a way to deal with errors:

informer.on('error', (err: k8s.V1Pod) => {
  console.error(err);
  // Restart informer after 5sec
  setTimeout(() => {
    informer.start();
  }, 5000);
});

But when an error occurs (eg. the api server pod is restarted) if you restart the informer with informer.start(), all the events (add, delete, update) are never fired again.
I don't know if this is a desired behaviour and the example is wrong or the example is fine and the informer has a bug.

** Client Version **
0.16.3

** Server Version **
Kubernetes v1.23.3

To Reproduce
Execute the informer, restart the api server, observe that informer events are never fired

Expected behavior
After an error event and an informer restart, all add/delete/update event for the informer should be fired again

Environment (please complete the following information):

  • OS: MacOs (minikube v1.25.2)
  • NodeJS Version v16.14.0
  • Cloud runtime minikube v1.25.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    lifecycle/rottenDenotes an issue or PR that has aged beyond stale and will be auto-closed.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions