dotnet-operator-sdk icon indicating copy to clipboard operation
dotnet-operator-sdk copied to clipboard

[bug]: Watcher stops watching custom resource after some time

Open OQCDoe opened this issue 1 year ago • 0 comments

Describe the bug

I am deploying a pretty basic operator into our k8s cluster (v1.28.5) and after a while (around 1 hour) we receive this event in our log:

{"Timestamp":"2024-05-17 13:11:04Z","EventId":0,"LogLevel":"Debug","Category":"KubeOps.Operator.Watcher.LeaderAwareResourceWatcher","Message":"The watcher received a known error from the watched resource \u0022V1TestEntity\u0022. This indicates that there are no instances of this resource.","State":{"Message":"The watcher received a known error from the watched resource \u0022V1TestEntity\u0022. This indicates that there are no instances of this resource.","resource":"V1TestEntity","{OriginalFormat}":"The watcher received a known error from the watched resource \u0022{resource}\u0022. This indicates that there are no instances of this resource."}}

When deploying a custom resource after this message appears, the ReconcileAsync message doesnt get called an no further log messages are written.

To reproduce

  1. Write basic Operator with v9.1.0
  2. Deploy Operator to k8s 1.28.5
  3. Do not deploy any instances of the custom resource
  4. Wait >1 hour
  5. Deploy an instance of the CR
  6. Operator does not fire

Expected behavior

The Operator should reconcile CRs even after some time has passed and even if there are no instances of CRs for a while

Screenshots

No response

Additional Context

The relevant code

OQCDoe avatar May 17 '24 15:05 OQCDoe