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

fix newest-file selection for offline cache #1425

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

burmudar
Copy link

@burmudar burmudar commented Dec 9, 2024

This is a port of chainguard-dev/go-apk#216

Copying the PR description here for brevity:

(Issue discovered while using https://github.com/chainguard-dev/rules_apko)

Given the following keyrings:

the following directory structure is created:

cache_wolfi_base_apko/https%3A%2F%2Fpackages.sgdev.org%2F/
├─ chainguard/
│  ├─ chainguard-enterprise.rsa.pub
├─ sourcegraph-melange-prod.rsa.pub

This is fine when looking for the public key file for https://packages.sgdev.org/chainguard/chainguard-enterprise.rsa.pub, but may fail for https://packages.sgdev.org/sourcegraph-melange-prod.rsa.pub if the directory chainguard/ has a newer timestamp than the public key file (I was not able to reproduce this locally on darwin, but reliably on linux CI machines).

This PR addresses this by not selecting directories as possible "newest" dir entries.

> fix newest-file selection for offline cache
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.

1 participant