Skip to content

DeleteControl's scheduleDelay not working #1807

Closed
@xiaoma20082008

Description

@xiaoma20082008

Bug Report

I created a CRD Reconciler which implements Reconciler and Cleaner like this:

public class MySpec {}
public class MyStatus {}
public class MyCRD extends CustomResource<MySpec, MyStatus> implements Namespaced {
}
public class MyReconciler implements Reconciler<MyCRD>, Cleaner<MyCRD> {

    // ignored reconcile
    
    @Override
    public DeleteControl cleanup(MyCRD resource, Context<MyCRD> context)  {
        // here, expect is 1 days later to clean, but got event frequently
        return DeleteControl.noFinalizerRemoval().rescheduleAfter(1, TimeUnit.DAYS);
    }
} 

What did you do?

kubectl delete -f crd.yaml

What did you expect to see?

if today is 2023-03-10, then I expect got the new cleanup event at 2023-03-11

What did you see instead? Under which circumstances?

Expect is 1 days later to clean, but get new cleanup event frequently in microseconds

Environment

Kubernetes cluster type:

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

<dependency>
    <groupId>io.javaoperatorsdk</groupId>
    <artifactId>operator-framework</artifactId>
    <version>4.2.7</version>
</dependency>

$ java -version

➜  ~ java -version
openjdk version "17.0.3" 2022-04-19
OpenJDK Runtime Environment Temurin-17.0.3+7 (build 17.0.3+7)
OpenJDK 64-Bit Server VM Temurin-17.0.3+7 (build 17.0.3+7, mixed mode, sharing)

$ kubectl version

➜  ~ kubectl version
Client Version: version.Info{Major:"1", Minor:"25", GitVersion:"v1.25.4", GitCommit:"872a965c6c6526caa949f0c6ac028ef7aff3fb78", GitTreeState:"clean", BuildDate:"2022-11-09T13:36:36Z", GoVersion:"go1.19.3", Compiler:"gc", Platform:"darwin/amd64"}
Kustomize Version: v4.5.7
Server Version: version.Info{Major:"1", Minor:"18+", GitVersion:"v1.18.8-aliyun.1", GitCommit:"2cbb16c", GitTreeState:"", BuildDate:"2021-01-27T02:20:04Z", GoVersion:"go1.13.15", Compiler:"gc", Platform:"linux/amd64"}

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions