Skip to content

bundle controller shard filtering based on cluster changes #4484

@adibrastegarnia

Description

@adibrastegarnia

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Previously we had a discussion about bundle controller was not filtering bundles correctly based on shard ID and this PR tried to address it #4282 (#4275). however, I don't think this PR solves the issue completely.

Let’s assume I labeled my GitRepo and Bundle as shard-0, while the cluster resource (which is independent of these objects) is labeled as shard-1. If a GitRepo is created first and a cluster is added later, the cluster change triggers the bundle controller. However, since the cluster is in shard-1, the controller cannot find any bundles to reconcile because the bundles generated by the GitRepo belong to shard-0.

To resolve this, I believe WithEventFilter(sharding.FilterByShardID(r.ShardID)) should be removed so it no longer applies to all resources. Instead, we should apply shard filtering specifically to the Bundle and BundleDeployment watchers. We should allow all clusters to trigger the watch, then filter the bundles based on the shard ID associated with the cluster that triggered the watch.

cc @0xavi0

Expected Behavior

No response

Steps To Reproduce

No response

Environment

- Architecture:
- Fleet Version:
- Cluster:
  - Provider:
  - Options:
  - Kubernetes Version:

Logs

Anything else?

No response

Metadata

Metadata

Labels

Type

No fields configured for Bug.

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions