Skip to content

bug: SyncAgent ignores Finalizer on deletion #115

@BergCyrill

Description

@BergCyrill

Describe the bug

As soon as a resource in a kcp workspace is requested to be deleted the api-syncagent will proceed to delete the corresponding resource in the service provider cluster. This does even happen if there are (other) finalizers set on the resource in kcp which should prevent this deletion behavior.

Related lines:

func (s *objectSyncer) Sync(ctx context.Context, log *zap.SugaredLogger, source, dest syncSide) (requeue bool, err error) {
// handle deletion: if source object is in deletion, delete the destination object (the clone)
if source.object.GetDeletionTimestamp() != nil {
return s.handleDeletion(ctx, log, source, dest)
}

Steps To Reproduce

  1. Create a resource for a synced API
  2. Add a custom finalizer "foo/bar"
  3. Request this resource to be deleted
  4. Watch API-SyncAgent to delete the resource in the service provider cluster

Expected Behaviour

I would expect the api-syncagent to respect finalizers and only delete a synced resource in the service provider cluster if there are no more finalizers (except for the own one) set on the resource in kcp.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions