Skip to content

Allow passing SetWatchErrorHandler to created informers #2231

@rfratto

Description

@rfratto

Currently, when a new informer is created, it will wait for a cache sync before returning to the caller.

Unless the provided context is canceled, this call blocks forever if the informer fails to perform the ListWatch operation, such as being given an invalid Kubernetes API server address or if the authentication is lacking appropriate credentials to access the requested resource.

I would like the ability to pass a WatchErrorHandler in cache.Options to created informers so I can log the specific error back to the user to help them understand why things aren't working.

Until this is available, there are two workarounds I've identified:

  • Pass a context which has a timeout, which prevents the call from blocking forever but you don't know what the underlying error is.
  • Rely on the default implementation for WatchErrorHandler, but this doesn't work for systems that aren't using klog.

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