Skip to content

Improve handling of "many GitRepos pointing to the same branch" #3871

@p-se

Description

@p-se

The prevalent opinion on how to do CI/CD right is to keep things in one branch, not use many.

Using Fleet this can be realized in two different ways:

  1. one GitRepo resources pointing to several paths.
  2. Many different GitRepo resources pointing to the same git repository but using multiple, different paths, and

Both ways pose challenges in the way they are implemented in Fleet.

  1. Having one GitRepo resource pointing to many paths in the git repository leads to the Bundles for all paths to be recreated if a commit is added to the git repository, even if content for the path has not changed.
  1. Having many GitRepo resources pointing to the same git repository leads to the same git repository being polled for changes, cloned and updated many times.
  • apply creates bundles, several have unchanged resources, but a new commit
  • bundle reconciler processes bundles
    • lists all bundledeployments
    • calculates all bundledeployments
    • creates next 50, requeues

When multiple GitRepos use the same branch and different paths to define bundles, a single commit to that branch triggers all associated GitRepos. Each GitRepo recreates its bundles even if only one path changed.

graph LR
A[Commit to Shared Branch - modify only path **b**] --> B[GitRepo 1 / path a]
A --> C[GitRepo 2 / path a,b,c]
B --> D[Recreate Bundle a]
C --> G[Recreate Bundle a]
C --> E[Recreate Bundle **b**]
C --> F[Recreate Bundle c]
Loading

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    To Triage

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions