Skip to content

chore: stop dynamic controller without restarting the kratix-controller-manager #589

@SaphMB

Description

@SaphMB

Context

When a promise is deleted, part of the cleanup requires stropping or deleting the dynamic controller that is created for that promise. At present, the dynamic controller for the promise is disabled and the manager is restart. This was introduced as a workaround and we have had a longstanding TODO to update the promise_controller to no longer restart the disable the controller and restart the manager, but delete the dynamic controller.

//temporary fix until https://github.com/kubernetes-sigs/controller-runtime/issues/1884 is resolved
//once resolved, delete dynamic controller rather than disable
if d, exists := r.StartedDynamicControllers[promise.GetDynamicControllerName(o.logger)]; exists {
	r.RestartManager()
	enabled := false
	d.Enabled = &enabled
}

The expected fix in controller runtime was never introduced and a few attempts to introduce this behaviour were discontinued. This could serve as a good opportunity to contribute to controller runtime to introduce behaviour other users have also expressed an interest in.

Acceptance

Given I have a promise installed on my kratix-managed platform
When I delete my promise
Then I do not observe my kratix manager restarting

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions