krateoplatformops / git-provider

Krateo PlatformOps Git Provider
0 stars 0 forks source link

Feature Request - Update Implementation and revised controller behaviour #10

Closed matteogastaldello closed 1 year ago

matteogastaldello commented 1 year ago

Feature Requested

  1. Prevent overwriting files in the target repository with files having the same name in the origin repository.
  2. Ensure that the controller keeps the target repository updated with any changes that occur in the origin repository.

Feature Implementation

  1. To address the first requirement, files already present in the target repository are excluded using a strategy similar to the one used for excluding files from rendering with a .krateoignore file. These files are added to a Gitignore list and checked for matches before copying.
  2. For the second requirement, during each reconciliation round, the controller checks in the Observe method whether the commit saved in the status of the custom resource matches the commit in the origin repository. The resource is then reconciled using the Update method.