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

oras pull shouldn't require --media-type or --allow-all #130

Closed
SteveLasker opened this issue Oct 4, 2019 · 11 comments · Fixed by #387
Closed

oras pull shouldn't require --media-type or --allow-all #130

SteveLasker opened this issue Oct 4, 2019 · 11 comments · Fixed by #387
Assignees
Labels
bug Something isn't working
Milestone

Comments

@SteveLasker
Copy link
Contributor

When using oras for local testing and validation, we shouldn't have to specify the media-type. Registries only support a single type for a given content addressable url.
Requiring the -media-type only complicates the default learning experience

@shizhMSFT
Copy link
Contributor

The --media-type and --allow-all are used to prevent downloading unnessary blobs.

For example, use oras to try to pull a helm chart from a large docker image. The operation should fail without downloading the docker image.

@SteveLasker
Copy link
Contributor Author

The user should be aware of what they're pulling. Having to specify both the image:tag reference, and the media-type is duplicate info. Having to type --allow-all is just another parameter they must type, even though they know the reference they want.

It would be like requiring someone to specify linux or windows on a multi-arch image. They're specifying the tag. The rest just happens.

@shizhMSFT
Copy link
Contributor

@SteveLasker Are you suggesting that we should make --allow-all=true by default? /cc @jdolitsky

@SteveLasker
Copy link
Contributor Author

Are you suggesting that we should make --allow-all=true

Yup.

But, talking with @sajayantony , I realized this has the assumption that we've done the split #181 of the oras binary and oras-library. The assumption is the library has all the strict apis, enabling very specific configurations. Meaning, reg-doc would push and pull the mediaType=application/x.reg-doc.
However, in the oras binary, we'd be more generic.

Rather than having to specify

oras push localhost:5000/foo:bar \
  --manifest-config /dev/null:application/x.thingthang.v0 \
      file.txt:application/tar

oras pull localhost:5000/foo:bar --allow-all

I could simply do:

oras push localhost:5000/foo:bar file.txt
oras pull localhost:5000/foo:bar

The resultant manifest would be:

{
  "schemaVersion": 2,
  "config": {
    "mediaType": "application/x.unknown.config.v0+json",
    "digest": "sha256:e752324f6804d5d0b2c098f84507d095a8fd0031cf06cdb3c7ad1625dcd1b399",
    "size": 7097
  },
  "layers": [
    {
      "mediaType": "application/tar",
      "digest": "sha256:83c5cfdaa5385ea6fc4d31e724fd4dc5d74de847a7bdd968555b8f2c558dac0e",
      "size": 25851449
    }
  ]
}

@shizhMSFT
Copy link
Contributor

Let's remove the option --allow-all and related options from the CLI to improve the UX. /cc @qweeah

@qweeah
Copy link
Contributor

qweeah commented May 17, 2022

ack

@SteveLasker
Copy link
Contributor Author

@shizhMSFT just confirming the tar mediaType. Will all files be placed in a tar archive, meaning it will also maintain the file names without the annotation? This would really help simplify things. Having the api support all granularity would enable implementers to make their choice per type.

@shizhMSFT
Copy link
Contributor

@SteveLasker That's still in the discussion (see #178 ). Also,

Will all files be placed in a tar archive, meaning it will also maintain the file names without the annotation?

The above statement looks a brand new topic to discuss with.

@osamamagdy
Copy link

Although the pull command documentation is updated and mentions this issue as a reason to eliminate --media-type and --allow-all, yet the oras pull --help and the implementors' documentation are not updated. I was very confused while trying to work with those flags. Should we open a separate issue for this?

@FeynmanZhou
Copy link
Member

Although the pull command documentation is updated and mentions this issue as a reason to eliminate --media-type and --allow-all, yet the oras pull --help and the implementors' documentation are not updated. I was very confused while trying to work with those flags. Should we open a separate issue for this?

@osamamagdy Yes, please help to raise a new issue to track. I think we need to update the documentation accordingly.

@qweeah
Copy link
Contributor

qweeah commented Aug 9, 2022

@osamamagdy thanks for bring this up, I already raised a PR to fix it oras-project/oras-www#45

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants