Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lazy sync doesn't work for the same path in different forms #347

Closed
Zebradil opened this issue Jan 2, 2024 · 1 comment · Fixed by #341
Closed

Lazy sync doesn't work for the same path in different forms #347

Zebradil opened this issue Jan 2, 2024 · 1 comment · Fixed by #341
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed

Comments

@Zebradil
Copy link
Member

Zebradil commented Jan 2, 2024

What steps did you take:

Removed trailing slash from a directory path in a vendir.yml which was synced before and ran vendir sync again.

What happened:

The source was downloaded again even though lazy option was enabled in the config.

What did you expect:

I expect vendir to skip download, because the config essentially wasn't changed.

Anything else you would like to add:

Consider the following vendir.yml:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
  - path: charts/  # ←  Note the trailing slash here
    contents:
      - path: httpbingo
        lazy: true
        helmChart:
          name: httpbingo
          version: 0.1.1
          repository:
            url: https://estahn.github.io/charts

Running initial vendir sync downloads the source and prints the following:

Fetching: charts/ + httpbingo (helm chart from https://estahn.github.io/charts@httpbingo:0.1.1)

Lock config

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - configDigest: b2cea40a7a3969525b8b4d51bf0797d5059bad2759fc93c614378a0015cc90d6
    helmChart:
      appVersion: v2.2.2
      version: 0.1.1
    path: httpbingo
  path: charts/
kind: LockConfig

Succeeded

Now run vendir sync again to see that the download is skipped due to the lazy flag:

Skipping fetch: charts/ + httpbingo (flagged as lazy, config has not changed since last sync)

Lock config

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - configDigest: b2cea40a7a3969525b8b4d51bf0797d5059bad2759fc93c614378a0015cc90d6
    helmChart:
      appVersion: v2.2.2
      version: 0.1.1
    path: httpbingo
  path: charts/
kind: LockConfig

Succeeded

Now remove the trailing slash from the config as it is not needed in fact:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
  - path: charts  # ←  Note the trailing slash is gone
    contents:
      - path: httpbingo
        lazy: true
        helmChart:
          name: httpbingo
          version: 0.1.1
          repository:
            url: https://estahn.github.io/charts

And run vendir sync again:

Fetching: charts + httpbingo (helm chart from https://estahn.github.io/charts@httpbingo:0.1.1)

Lock config

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - configDigest: b2cea40a7a3969525b8b4d51bf0797d5059bad2759fc93c614378a0015cc90d6
    helmChart:
      appVersion: v2.2.2
      version: 0.1.1
    path: httpbingo
  path: charts
kind: LockConfig

Succeeded

The source was downloaded again.

Environment:

  • vendir version: 0.38.0
  • OS: latest Arch Linux x86_64

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.

@Zebradil Zebradil added bug This issue describes a defect or unexpected behavior carvel-triage This issue has not yet been reviewed for validity labels Jan 2, 2024
@kumaritanushree
Copy link
Contributor

@Zebradil thank you for raising this issue and adding changes to fix it in PR #341.

@renuy renuy added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed carvel-triage This issue has not yet been reviewed for validity labels Jan 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue describes a defect or unexpected behavior carvel-accepted This issue should be considered for future work and that the triage process has been completed
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants