-
Notifications
You must be signed in to change notification settings - Fork 224
Description
Environment
- Operator SDK: 5.1.2
- Operator SDK Spring Boot Starter: 6.1.1
- Kubernetes: Kind cluster, version 1.32
Issue Summary
I am observing unexpected behavior when watching a secondary Secret resource in my operator application. The operator application consists of two reconcilers: CrAReconciler and CrBReconciler. When the operator application starts, both reconcilers are registered, and I observe the following behavior:
- If the operator starts and a CrB Custom Resource (CR) already exists, CrBReconciler correctly finds the Secret in its cache (e.g., via context.getSecondaryResources(Secret::class.java)).
- If the operator starts and the CrB CR does not exist initially (but is applied later), CrBReconciler does not find the Secret in its cache when the CrB CR is created. The Secret is only discovered after either restarting the operator application or modifying/recreating the Secret.
Important Note
The Secret is not managed by the operator itself. In the Reconciler, only an additional event source is created to watch the external Secret.
Expectation
The Secret should also be discovered when the CrB CR is applied after the operator has already started.
Reproducer
I have created a reproducer demonstrating this behavior: https://github.com/ebma16/josdk-sample-secret-not-in-cache
This reproducer is available for review and testing for @csviri and @metacosm