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

refactor: upgrade cache logic to vendir 0.38.0 #147

Merged
merged 8 commits into from
Dec 21, 2023

Conversation

fritzduchardt
Copy link
Collaborator

With the improved handling of lock files in vendir 0.38.0 we can simplify our own cache logic and make it more granular to operate on vendir.yaml directory level

Copy link

codecov bot commented Dec 17, 2023

Codecov Report

Attention: 9 lines in your changes are missing coverage. Please review.

Comparison is base (d9ed5ad) 54.33% compared to head (6383042) 54.58%.

Files Patch % Lines
internal/myks/sync.go 18.18% 8 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #147      +/-   ##
==========================================
+ Coverage   54.33%   54.58%   +0.24%     
==========================================
  Files          23       23              
  Lines        2341     2325      -16     
==========================================
- Hits         1272     1269       -3     
+ Misses        874      862      -12     
+ Partials      195      194       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fritzduchardt fritzduchardt changed the title Upgrade cache logic to vendir 0.38.0 [chore] Upgrade cache logic to vendir 0.38.0 Dec 18, 2023
@fritzduchardt fritzduchardt changed the title [chore] Upgrade cache logic to vendir 0.38.0 chore!: Upgrade cache logic to vendir 0.38.0 Dec 18, 2023
@@ -321,6 +321,15 @@ func isExist(path string) (bool, error) {
return false, err
}

func isExistsSloppy(path string) bool {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm puzzled by the purpose of this function. I have two points to that:

  1. If you don't want to do error handling in the client code, you can use the following:
    exists, _ := isExists(path)
  2. However, I'd suggest against that. ErrNotExist is not the only possible error; in case of other errors, you probably want to be aware of them. (Example)

@Zebradil Zebradil changed the title chore!: Upgrade cache logic to vendir 0.38.0 refactor: upgrade cache logic to vendir 0.38.0 Dec 21, 2023
@Zebradil Zebradil merged commit d2b05d3 into dev Dec 21, 2023
5 checks passed
@Zebradil Zebradil deleted the upgrade-cache-logic-to-vendir-0.38.0 branch December 21, 2023 19:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants