Skip to content

IllegalArgumentException when deleting the primary of a dependent resource with activation condition #2221

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
Javatar81 opened this issue Jan 26, 2024 · 1 comment · Fixed by #2223
Assignees

Comments

@Javatar81
Copy link

Bug Report

ERROR [io.jav.ope.pro.eve.ReconciliationDispatcher] (ReconcilerExecutor-projectreconciler-350) Error during event processing ExecutionScope{ resource id: ResourceID{name='testproj', namespace='bschmeli-devjoy-test'}, version: 5000703288} failed.: io.javaoperatorsdk.operator.OperatorException: io.javaoperatorsdk.operator.OperatorException: io.javaoperatorsdk.operator.AggregatedOperatorException: Exception(s) during workflow execution. Details:

  • io.devjoy.operator.project.k8s.deploy.ApplicationDependentResource -> java.lang.IllegalArgumentException: There is no event source found for class:io.devjoy.operator.project.k8s.deploy.Application
    at io.javaoperatorsdk.operator.processing.event.EventSources.get(EventSources.java:127)
    at io.javaoperatorsdk.operator.processing.event.EventSourceManager.getResourceEventSourceFor(EventSourceManager.java:273)
    at io.javaoperatorsdk.operator.api.reconciler.DefaultContext.getSecondaryResource(DefaultContext.java:59)
    at io.javaoperatorsdk.operator.api.reconciler.Context.getSecondaryResource(Context.java:20)
    at io.javaoperatorsdk.operator.processing.dependent.AbstractDependentResource.getSecondaryResource(AbstractDependentResource.java:92)
    at io.javaoperatorsdk.operator.processing.dependent.SingleDependentResourceReconciler.delete(SingleDependentResourceReconciler.java:24)
    at io.javaoperatorsdk.operator.processing.dependent.AbstractDependentResource.delete(AbstractDependentResource.java:153)
    at io.javaoperatorsdk.operator.processing.dependent.workflow.WorkflowCleanupExecutor$CleanupExecutor.doRun(WorkflowCleanupExecutor.java:75)
    at io.javaoperatorsdk.operator.processing.dependent.workflow.NodeExecutor.run(NodeExecutor.java:22)
    at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:577)
    at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1623)
    at io.javaoperatorsdk.operator.processing.Controller.cleanup(Controller.java:212)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleCleanup(ReconciliationDispatcher.java:294)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleDispatch(ReconciliationDispatcher.java:89)
    at io.javaoperatorsdk.operator.processing.event.ReconciliationDispatcher.handleExecution(ReconciliationDispatcher.java:64)
    at io.javaoperatorsdk.operator.processing.event.EventProcessor$ReconcilerExecutor.run(EventProcessor.java:417)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
    at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
    at java.base/java.lang.Thread.run(Thread.java:1623)

What did you do?

I created a dependent resource extending CRUDNoGCKubernetesDependentResource. In addition, I defined an activationCondition for the dependent resource. The resource condition is always true.

I delete the primary resource.

What did you expect to see?

The primary resource should be deleted, the dependent should not be deleted (because not garbage collected).

What did you see instead? Under which circumstances?

The primary resource is stuck in deleting state and I get the exception mentioned above.

Environment

Kubernetes cluster type:

OpenShift 4.13.26

$ Mention java-operator-sdk version from pom.xml file

4.6.1

$ java -version

openjdk version "20.0.1" 2023-04-18
OpenJDK Runtime Environment Temurin-20.0.1+9 (build 20.0.1+9)
OpenJDK 64-Bit Server VM Temurin-20.0.1+9 (build 20.0.1+9, mixed mode)

$ kubectl version

Client Version: v1.28.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.26.11+7dfc52e

Possible Solution

No

Additional context

No

@csviri
Copy link
Collaborator

csviri commented Jan 26, 2024

Thx @Javatar81

This is an issue with the Activation condition. Theoretically can happen when resources is deleted before the first reconciliation happened. But will try to reproduce it also in a dedicated integration test, and see if there are other edge cases that we should handle.

@csviri csviri self-assigned this Jan 26, 2024
@csviri csviri linked a pull request Jan 29, 2024 that will close this issue
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.

2 participants