chainguard-dev / apko

Build OCI images from APK packages directly without Dockerfile
https://apko.dev
Apache License 2.0
1.2k stars 122 forks source link

Fail if APKINDEX has single-character lines #1321

Closed jonjohnsonjr closed 1 month ago

jonjohnsonjr commented 1 month ago

We expect some blank lines, which delimit each entry. We expect every other line to have at least e.g. "C:", i.e. a single character followed by a colon.

I looked at our current APKINDEX to make sure I'm not missing anything:

$ awk '{print length}' APKINDEX | sort -n | uniq -c | head
83376 0
11137 2
7807 3
1214 4
18924 5
23738 6
49958 7
126520 8
62586 9
86165 10

We don't have any single-character lines, so this change should be fine.