Skip to content

Feature Request: Enable Fleet webhooks to work with GitRepo resources that point to a tag or specific revision #3474

Open
@ahf90

Description

@ahf90

Is your feature request related to a problem?

Currently, webhooks only trigger updates when a GitRepo tracks a branch. Supporting tags or fixed revisions would improve flexibility, enabling webhook-driven updates in more controlled release workflows.

For example, our test cluster GitRepos watch tags so we can push changes to clusters before the PR process.

Solution you'd like

I would like the GitJob Controller to create a new Job to refresh the Bundle whenever a webhook is received indicating an update to a Git tag.

Alternatives you've considered

No response

Anything else?

I think the source of the problem is here:
https://github.com/rancher/fleet/blob/main/pkg/webhook/webhook.go#L209

The Webhook function does not update the status of any GitJob that has a revision field set.

Since GitRepos that track a tag include a revision field, they are effectively ignored by the webhook handler, which prevents the associated Bundle from being refreshed.

apiVersion: gitjob.cattle.io/v1
kind: GitJob
metadata:
  name: foo-bar
  namespace: fleet-test
spec:
  git:
    repo: ssh://[email protected]/kub/foo-bat-baz.git
    revision: foo-bar-test
status:
  commit:foo-bar-test

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🆕 New

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions