Skip to content

Previous operator version of custom resources don't get deleted #1679

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

Closed
popdaniel942 opened this issue Dec 23, 2022 · 3 comments · Fixed by #1681
Closed

Previous operator version of custom resources don't get deleted #1679

popdaniel942 opened this issue Dec 23, 2022 · 3 comments · Fixed by #1681
Assignees

Comments

@popdaniel942
Copy link

popdaniel942 commented Dec 23, 2022

I was using operator version 4.1.2 and I had some CRDs and some instances of those CRDs. In the meantime I updated the operator to 4.2.0 and I also update the CRDs a little. And now if I try to remove the resources, the cleanup code is called, it is finished with a DeleteControl.defaultDelete() but then the resource does not get deleted...If I remove the finalizer manually, it gets deleted and if I recreate it with the new operator version and the updated CRDs, all is good, the deletion removes the custom resource but in the logs I always get the below error. Am I doing something wrong? Is there a problem removing custom resources that were created by a previous version of the operator or by previous versions of CRDs?

io.javaoperatorsdk.operator.processing.event.source.controller.ControllerResourceEventSource@71154f21 event handler: Should not be called with DELETED
java.lang.IllegalStateException: Should not be called with DELETED
	at io.javaoperatorsdk.operator.processing.event.source.controller.ControllerResourceEventSource.isAcceptedByFilters(ControllerResourceEventSource.java:98)
	at io.javaoperatorsdk.operator.processing.event.source.controller.ControllerResourceEventSource.eventReceived(ControllerResourceEventSource.java:75)
	at io.javaoperatorsdk.operator.processing.event.source.controller.ControllerResourceEventSource.onDelete(ControllerResourceEventSource.java:118)
	at io.javaoperatorsdk.operator.processing.event.source.controller.ControllerResourceEventSource.onDelete(ControllerResourceEventSource.java:28)
	at io.fabric8.kubernetes.client.informers.impl.cache.ProcessorListener$DeleteNotification.handle(ProcessorListener.java:122)
	at io.fabric8.kubernetes.client.informers.impl.cache.ProcessorListener.add(ProcessorListener.java:50)
	at io.fabric8.kubernetes.client.informers.impl.cache.SharedProcessor.lambda$distribute$0(SharedProcessor.java:87)
	at io.fabric8.kubernetes.client.informers.impl.cache.SharedProcessor.lambda$distribute$1(SharedProcessor.java:110)
	at io.fabric8.kubernetes.client.utils.internal.SerialExecutor.lambda$execute$0(SerialExecutor.java:58)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
	at java.base/java.lang.Thread.run(Thread.java:833)
@amitmun
Copy link

amitmun commented Dec 25, 2022

It happens to me as well with a brand new controller.
Probably related to this commit:
952a26b#diff-8f1d28fd39d275362172bc40fe173ae3b8c51eea32424869fb0326701459b42aR97
@metacosm

@csviri csviri linked a pull request Dec 25, 2022 that will close this issue
@csviri
Copy link
Collaborator

csviri commented Dec 25, 2022

Yes @amitmun you are right, that should not be there, delete events should get to EventProcessor always. Attached the PR for fix.

@csviri
Copy link
Collaborator

csviri commented Dec 25, 2022

@metacosm we should merge this and create a patch release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants