-
Notifications
You must be signed in to change notification settings - Fork 218
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error deleting a custom resources #2679
Comments
Hi @jalonsomagnolia , thx for reporting, taking a look! |
@jalonsomagnolia could you pls provide a simple reproducer? this works correctly in integration tests like this That logic is actually right, since in this case it should be basically an empty no-op workflow there. |
Thanks for the response @csviri . I'll provide you the reproducer asap. But in the meantime, let me understand something:
We don't want to invoke this
Then, if you say that the ìf` condition is correct, then maybe the initialiser is incorrect:
In our case, Finally, notice that the code in version 4.9.7, which works fine, was like this:
The change is adding that new |
Hi right there is an issue, your right, it is a bit more complex than it first seems, pls take a look on attached PR if makes sense. Will add unit tests soon. |
Good morning @csviri . Here it is the reproducer project. As you can see it's a really simple operator, but if you create a CR and then tries to delete, you'll have this exception
|
@jalonsomagnolia the issue is that this exception is not thrown in any of our samples or any integration tests; those are spinning up real controllers, so I'm not able to reproduce. Would be nice to have a sample operator provided to use (within a github repo) But nevertheless I fixes the issue with that expression. It would be a help if you could build a local copy from that branch or after merged to main, and try you operator with that if the problem disappears. Thank you! |
Oh, sorry. I forgot to include the link 🤦 . Here it is -> https://gitlab.magnolia-platform.com/micro-services/public/simple-operator |
Ahh, I checked the sample just now, it is in Quarkus Operator SDK, that is a completely different story, probably this fix will help on that, but the workflow is created in a different way there. cc @metacosm @xstefank you might want to check that, and add an integration / e2e test for this use case. (I tested locally manually, it seems that the pr fixed the issue) |
Thanks for the fix. I can confirm it works like a charm |
Thank you for reporting @jalonsomagnolia !! |
Bug Report
After upgrading to the java-operator-sdk 5.0, we have the following error when we try to delete a custom resource:
Everything worked fine before moving to 5.0.
Our controller is configured with something like this:
The code fails before calling our
cleanup
.Checking the controller code, where the error is being thrown, I can see
Shouldn't be instead
if (managedWorkflow.hasCleaner() || explicitWorkflowInvocation) {
(so only when explicitWorkflowInvocation = true). By default@Workflow
hasexplicitWorkflowInvocation = false
, so I understand that unless you want to implement a workflow, this code shouldn't be called.The text was updated successfully, but these errors were encountered: