Skip to content

Webhook updating wrong GitRepo #4648

@JasonBThelen

Description

@JasonBThelen

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I have webhooks set up with Fleet for several repositories in Github. One named like "apps-deployments" for common dependencies for all downstream clusters. Then a set of cluster specific repositories that follow the pattern "apps-deployments-{cluster-name}".

When the "apps-deployments" repo sends a webhook to Fleet, I'm seeing the latest commit hash for that repository get set as the webhookCommit in the GitRepo associated with that Github repo AND all the cluster-specific repositories that start with the same string "apps-deployments".

Expected Behavior

A webhook call for a repo "apps-deployments" should only update GitRepo that references that specific repository and not others that reference repos that partially match the name.

Steps To Reproduce

  1. Have Fleet set up to receive webhooks
  2. Set up a repo like "repo1" and configure the webhook to notify Fleet
  3. Create a GitRepo referencing "repo1" in Fleet
  4. Set up a second repo, named the same as the first repo plus some suffix, like "repo1-suffix"
  5. Create a GitRepo referencing "repo1-suffix"
  6. Push a commit to "repo1" to trigger the webhook
  7. Check the GitRepo for "repo1-suffix" - the commit and webhookCommit will have a commit hash from "repo1"

Environment

- Architecture: amd64
- Fleet Version: 0.13.5 (Rancher v2.12.3)
- Cluster:
  - Provider: EKS
  - Options:
  - Kubernetes Version: v1.33.6

Logs

Anything else?

No response

Metadata

Metadata

Type

No fields configured for Bug.

Projects

Status

✅ Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions