Repository navigation
fix: detect Windows drive letter in oci-layout reference with forward slashes - #1372
Open
arpitjain099 wants to merge 1 commit into
Open
arpitjain099 wants to merge 1 commit into
arpitjain099 wants to merge 1 commit into
Conversation
… slashes Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: Arpit Jain <arpitjain099@gmail.com>
arpitjain099
requested review from
NiazFK,
gokarnm,
priteshbandi,
rgnote,
shizhMSFT,
toddysm,
vaninrao10 and
yizha1
as code owners
October 20, 2026 03:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
parseOCILayoutReferenceonly treats a leadingC:as a Windows drive letter when the third byte is a backslash, so--oci-layout C:/layouts/foofalls through to the generic tag split, producing pathCand tag/layouts/foo. The user then gets a stat failure on a file namedCinstead of the "missing tag or digest" error this case is meant to produce. Windows accepts forward slashes in paths, and/layouts/foocannot be a valid OCI tag, so no legitimate input is affected. The fix accepts either separator.I added a table-driven test for the function covering both separators. The forward-slash no-reference case fails on main and passes with the change; the rest of
cmd/notationis unaffected.Scope is narrow: this only changes the error message a Windows user sees. The function is plain string parsing with no
runtime.GOOSorfilepathuse, so the test drives the same code anywhere, but I ran it on macOS, not Windows.AI assistance was used on this change and is disclosed in the commit trailer.