Replies: 1 comment
-
Looking at the code is looks the actual resource is null. This is suspicious to me |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
I will start to post here before opening an issue because I'm not sure if it's a bug or bad usage of the operator SDK.
Using Java operator SDK with Quarkus extension (Operator SDK 5.1.1 / Quarkus Java Operator SDK extension 7.2.0). So latest at time of writting
I'm writting my first operator. This is my setup (OKD). I got inpired from the mysql-schema sample https://github.com/operator-framework/java-operator-sdk/tree/main/sample-operators/mysql-schema
Basically it's a CR that create a service account on LDAP and save the secret on K8S
My issue occurs only when my controller restart (The native container image, I cannot reproduce with quarkus dev, not sure why). The issue is that the operator tries to recreate the secret even if already exists
Code snippet
I'm also adding some part of the external dependent but I don't think it's the issue since it depends on the secret and is able to observed the external resource without issue. And it's desired state matches it's observed state
Before getting the 409 conflict I was able to capture some debug logs
I never see my
Matching Secret ***
logs. So I can imagine that the desired state doesn't match and the secret is created.I basically observe the exact same for a Secret dependent that doesn't change (the desired state is always the same).
I cannot reproduce with 'quarkus dev' so I'm wondering if it's some "race condition" when the operator state on the Quarkus native image? After few seconds, all the resources become reconcilies, but I have always this exception when the operator restart, putting all CR in error when it should just skip the reconciliation since the state didn't changed between restart.
Or do you see anything wrong with my implementation?
Thanks for the help!
Beta Was this translation helpful? Give feedback.
All reactions