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!: allow colon and back slash in unix file name #734

Closed
wants to merge 11 commits into from

Conversation

qweeah
Copy link
Contributor

@qweeah qweeah commented Jan 4, 2023

Resolves #695

To provide a file name with colon(:) and media-type at the same time, we can use backslash(\) to escape the colon in the file name, taking oras push as an example:

oras push some.reg/repo:tag "my\:file:my.media.type" # will push a file named `my:file` with mediatype `my.media.type`

Backslash can be used to escape itself:

oras push some.reg/repo:tag "my\\file:my.media.type" # will push a file named `my\file` with mediatype `my.media.type`

The old workaround still works after this change:

oras push some.reg/repo:tag my:file:my.media.type: # will push a file named `my:file` with mediatype `my.media.type`

Signed-off-by: Billy Zha jinzha1@microsoft.com

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@codecov-commenter
Copy link

codecov-commenter commented Jan 4, 2023

Codecov Report

Merging #734 (d9bfe6c) into main (cdeca2f) will increase coverage by 1.20%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #734      +/-   ##
==========================================
+ Coverage   73.17%   74.37%   +1.20%     
==========================================
  Files          16       16              
  Lines         574      601      +27     
==========================================
+ Hits          420      447      +27     
  Misses        123      123              
  Partials       31       31              
Impacted Files Coverage Δ
cmd/oras/internal/fileref/unix.go 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
cmd/oras/internal/fileref/unix_test.go Outdated Show resolved Hide resolved
cmd/oras/internal/fileref/unix_test.go Outdated Show resolved Hide resolved
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
Signed-off-by: Billy Zha <jinzha1@microsoft.com>
@shizhMSFT shizhMSFT added this to the future milestone Jan 11, 2023
@shizhMSFT shizhMSFT added question Further information is requested ux User experience related labels Jan 11, 2023
@TerryHowe
Copy link
Member

Merge conflict

@shizhMSFT shizhMSFT added the stale Inactive issues or pull requests label Mar 7, 2023
@qweeah
Copy link
Contributor Author

qweeah commented Mar 22, 2023

Close as it's easier to use the workaround

@qweeah qweeah closed this Mar 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested stale Inactive issues or pull requests ux User experience related
Projects
No open projects
Status: No status
Development

Successfully merging this pull request may close these issues.

ORAS attach seems to not support colon in filename
5 participants