File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -9,8 +9,12 @@ export function nameAndVersionFromTargetImage(targetImage: string): {
99 let imageName : string ;
1010 let imageVersion : string ;
1111
12- const finalSlash = targetImage . lastIndexOf ( "/" ) ;
13- if ( finalSlash >= 0 && targetImage . slice ( finalSlash ) . includes ( ".tar" ) ) {
12+ // TODO: this logic is not sufficient for OCI image references that end
13+ // in .tar (e.g. image:version.tar), which is a valid image name.
14+ // Additionally, the fallback parsing does not fully capture the information
15+ // availble in a valid archive name.
16+ // ref: https://github.com/containers/container-libs/blob/main/image/docs/containers-transports.5.md#containers-storagestorage-specifierimage-iddocker-referenceimage-id
17+ if ( ! targetImage . endsWith ( ".tar" ) ) {
1418 try {
1519 const parsed = parseImageReference ( targetImage ) ;
1620 return {
@@ -26,6 +30,7 @@ export function nameAndVersionFromTargetImage(targetImage: string): {
2630 // check any colon separator after the final '/'. If there are no '/',
2731 // which is common when using Docker's official images such as
2832 // "debian:stretch", just check for ':'
33+ const finalSlash = targetImage . lastIndexOf ( "/" ) ;
2934 const hasVersion =
3035 ( finalSlash >= 0 && targetImage . slice ( finalSlash ) . includes ( ":" ) ) ||
3136 targetImage . includes ( ":" ) ;
You can’t perform that action at this time.
0 commit comments