Skip to content

Operator controller could not delete correlated resources #1263

Closed
@barryzhounb

Description

@barryzhounb

In Kubernetes and Operator-sdk, we can define CRD (Custom Resource Definition) and CR (Custom Resource). In my operator controller, when a CR is initialized, then I create a new Deployment and service.

When we delete a CR object, then the correlated resources (such as Deployment or service) will be deleted as well at the same time. I understand it should be done by CR/CRD finalizer, this is just my guess.

Now I hit an issue, during Operator testing, under envTest environment, when I delete a CR, its correlated resources (Deployment or service) have not been deleted.

I am confused. In real k8s cluster, the correlated resources (Deployment or service) can be deleted automatically when I delete a CR, under envTest environment, why it doesn't delete correlated resources?

Could anybody point out the reason.

Metadata

Metadata

Assignees

No one assigned

    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