Skip to content

Oras pushes an artifact when uploaded file in the absolute path but fails in pull (tested with azure container registry) #973

@suganyas

Description

@suganyas

What happened in your environment?

I am trying to push an OCI artifact or any file to azure container registry using oras and it pushes fine when I set file path as absolute path in cli
Example : oras push acrsscregistrya.azurecr.io/testoras:1.0 --artifact-type exe /Users/suganyasrinivasan/Desktop/requirements.txt:application/exe
But fails while trying to pull it
oras pull acrsscregistrya.azurecr.io/testoras:1.0
But when I push it as relative path or in same directory as file it works fine
Example
cd /Users/suganyasrinivasan/Desktop
oras push acrsscregistrya.azurecr.io/testoras:2.0 --artifact-type exe requirements.txt:application/exe

Attached screenshots for both scenarios
Screenshot 2023-06-15 at 12 20 00 am
Screenshot 2023-06-15 at 12 26 33 am
Screenshot 2023-06-15 at 12 20 35 am

What did you expect to happen?

Oras should fail to push the file or set the path relatively right to pass pulling

The issue is most likely with the annotations set as absolute path and treated as relative in the oras. But not very sure. Like this -
https://github.com/oras-project/oras-py/blob/209c9b98043a00d1b04789cc2967ca7021dc5b2e/oras/oci.py#L49

How can we reproduce it?

Try to push an OCI artifact or any file to azure container registry using oras and it pushes fine when I set file path as absolute path in cli
Example : oras push acrsscregistrya.azurecr.io/testoras:1.0 --artifact-type exe /Users/suganyasrinivasan/Desktop/requirements.txt:application/exe
But fails while trying to pull it
oras pull acrsscregistrya.azurecr.io/testoras:1.0
But when I push it as relative path or in same directory as file it works fine
Example
cd /Users/suganyasrinivasan/Desktop
oras push acrsscregistrya.azurecr.io/testoras:2.0 --artifact-type exe requirements.txt:application/exe

What is the version of your ORAS CLI?

Version: 0.16.0+Homebrew
Go version: go1.19.3

What is your OS environment?

Mac, Linux

Are you willing to submit PRs to fix it?

  • Yes, I am willing to fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    duplicateThis issue or pull request already existsquestionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions