Skip to content

FinalizeKind is overkill for IMC dispatcher #4509

@mattmoor

Description

@mattmoor

Describe the bug

Today the IMC Dispatcher uses finalizers:

func (r *Reconciler) FinalizeKind(ctx context.Context, imc *v1.InMemoryChannel) reconciler.Event {
if imc.Status.Address != nil &&
imc.Status.Address.URL != nil {
if hostName := imc.Status.Address.URL.Host; hostName != "" {
logging.FromContext(ctx).Info("Removing dispatcher")
r.multiChannelMessageHandler.DeleteChannelHandler(hostName)
}
}
return nil
}

Expected behavior

When everything is in-memory, it makes more sense to actually do this kind of work directly in the informer callback rather than effectively blocking resource deletion on finalizer handling.

Knative release version

HEAD

Additional context

Due to the awkward handling of Finalizers on CRDs in Kubernetes, we should (IMO) limit our use of them to where it's absolutely needed, otherwise uninstall gets needlessly complex.

cc @vaikas

Metadata

Metadata

Assignees

Labels

area/channelskind/bugCategorizes issue or PR as related to a bug.

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions