operator-framework / operator-framework/java-operator-sdk

Method Reconciler#reconcile is not triggered when resource is deleted.

Open
#3,621 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Java
Stars
944
Forks
242
Avg merge
1d 4h
Merged PRs (30d)
43

Description

Bug Report

I wanted to create metric exporter for certain resource type.
For this I implemented Reconciler with triggerReconcilerOnAllEvents enabled (introducerd in JOSDK 5.2) to receive all events (create, update and delete).

Method Reconciler#reconcile is not triggered when resource is deleted.

What did you do?
@ControllerConfiguration(triggerReconcilerOnAllEvents = true, generationAwareEventProcessing = false)
public class MyResourceReconciler implements Reconciler<MyResource>{

    private static final Logger LOG = Logger.getLogger(MyResourceReconciler.class);

    @Override
    public UpdateControl<MyResource> reconcile(MyResource resource, Context<MyResource> context) throws Exception {
	   LOG.infof("Resource %s/%s event", resource.getMetadata().getNamespace(), resource.getMetadata().getName());
        if(context.isPrimaryResourceDeleted()){
            LOG.infof("deleted");
            return UpdateControl.noUpdate();
        }
        LOG.infof("created/updated");
        return UpdateControl.noUpdate();
    }

}
What did you expect to see?

When I create, update and delete resource I expected to see in logs:

INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-92) Resource mynamespace/myresource event
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-92) created/updated
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) Resource mynamespace/myresource event
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) created/updated
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) Resource mynamespace/myresource event
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) deleted
What did you see instead? Under which circumstances?

When I create, update and delete resource I see in logs:

INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-92) Resource mynamespace/myresource event
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-92) created/updated
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) Resource mynamespace/myresource event
INFO  [com.test.MyResourceReconciler] (ReconcilerExecutor-myresourcereconciler-93) created/updated
Environment

Kubernetes cluster type:

OpenShift 4.19.43

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

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>io.quarkus.platform</groupId>
                <artifactId>quarkus-bom</artifactId>
                <version>3.39.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
            <dependency>
                <groupId>io.quarkus.platform</groupId>
                <artifactId>quarkus-operator-sdk-bom</artifactId>
                <version>3.39.3</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependency>
        <groupId>io.quarkiverse.operatorsdk</groupId>
        <artifactId>quarkus-operator-sdk</artifactId>
    </dependency>

resolves to: io.javaoperatorsdk:operator-framework-core:5.5.0

$ java -version

openjdk version "25.0.4.1" 2026-08-18 LTS
OpenJDK Runtime Environment Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS)
OpenJDK 64-Bit Server VM Temurin-25.0.4.1+1 (build 25.0.4.1+1-LTS, mixed mode, sharing)

$ kubectl version

Client Version: 4.19.0-202608112108.p2.gb2a93a6.assembly.stream.el9-b2a93a6
Kustomize Version: v5.5.0
Kubernetes Version: v1.32.13

Additional context
  • resources does not have finalizers
  • adding defaultFilters = false to ControllerConfiguration did not helped

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with the provided MyResourceReconciler and ControllerConfiguration, then trace the event-processing path into Reconciler#reconcile for deletion events. Done means deletion triggers reconcile with context.isPrimaryResourceDeleted() true, while create and update behavior remains unchanged; add or update coverage if the relevant event-processing tests are found.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, kubernetes
Domain
devops, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.