vendir icon indicating copy to clipboard operation
vendir copied to clipboard

bug: lock file does not work as expected when using `depth: 1`

Open gabyx opened this issue 9 months ago • 0 comments

What steps did you take:

When you have

apiVersion: vendir.k14s.io/v1alpha1
kind: Config

directories:
  - path: src/swissfega/libs/_ytt_lib/custodian
    contents:
      - path: .
        git:
          url: https://gitlab.com/data-custodian/custodian.git
          ref: main
          depth: 1

        newRootPath: tools/deploy/manifests/src/custodian/libs/_ytt_lib/custodian

and you create a lock file and then add another commit on main in https://gitlab.com/data-custodian/custodian.git and then do vendir sync --locked it fails due to not finding the Git SHA.

What happened:

  • Could not vendir sync --locked due to depth:1

What did you expect:

  • vendir sync --locked must not take depth:1 into account forcefully as it will not find the Git SHA in 99% of the cases.
  • The behaviour should do git fetch with exponential back off by always git fetch --depth 20 and then git fetch --depth 40 and then git fetch --depth 80 etc till the refspec is found, giving the possibility to give up after a certain maxDepth you could set... (0 = infinity till no parent any more).

Anything else you would like to add: Also it would be very welcome if vendir could somehow cache the fetching generically for all content types to not redo the stuff over and over again. Would be a crazy speed up:

Environment:

  • vendir version (execute vendir --version): 0.44.0 Nix
  • OS (e.g. from /etc/os-release): NixOS

Vote on this request

This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.

👍 "I would like to see this addressed as soon as possible" 👎 "There are other more important things to focus on right now"

We are also happy to receive and review Pull Requests if you want to help working on this issue.

gabyx avatar Jun 24 '25 10:06 gabyx