-
Notifications
You must be signed in to change notification settings - Fork 100
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
Cannot Resolve descriptor: 404 not found while oras blob fetch
does find it
#823
Comments
oras blob fetch
does find itoras blob fetch
does find it
Doing it in code yields the same result: repo, err := remote.NewRepository("ghcr.io/open-component-model/mpas-bootstrap-component/fluxcd/notification-controller")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
desc, err := repo.Resolve(context.Background(), "sha256:2e3521c3642113452b802980672e7c4846c3f1069c5067c569d2bd64c7552764")
if err != nil {
fmt.Println("failed to resolve descriptor ", err)
os.Exit(1)
}
fmt.Println(desc.Digest) Fails too. |
That's weird, I know just noticed that the SHA is in fact not under the listed layers. But then what the heck is it fetching when using this sha? :D :D :D What's going on here? |
okay, I think I'm getting the wrong SHA somehow in my code. :/ This works: func main() {
repo, err := remote.NewRepository("ghcr.io/open-component-model/mpas-bootstrap-component/fluxcd/notification-controller")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
desc, err := repo.Resolve(context.Background(), "v1.3.0")
if err != nil {
fmt.Println("failed to resolve descriptor ", err)
}
fmt.Println(desc.Digest)
} Looks like, this will get the right thing. |
Hi @Skarlso,
To resolve a layer, you would need to explicitly specify the blob path by invoking repo, err := remote.NewRepository("ghcr.io/open-component-model/mpas-bootstrap-component/fluxcd/notification-controller")
if err != nil {
fmt.Println(err)
os.Exit(1)
}
- desc, err := repo.Resolve(context.Background(), "sha256:2e3521c3642113452b802980672e7c4846c3f1069c5067c569d2bd64c7552764")
+ desc, err := repo.Blobs().Resolve(context.Background(), "sha256:2e3521c3642113452b802980672e7c4846c3f1069c5067c569d2bd64c7552764")
if err != nil {
fmt.Println("failed to resolve descriptor ", err)
os.Exit(1)
}
fmt.Println(desc.Digest) |
OMG THAT WORKED. :D Hum, I need to redesign things 🤔 Check out if I do fetch the right thing. But thanks, this really helped me go further. :) Thank you again :DDDD <3 |
@Skarlso No problem. Good luck! 😀 |
I might need to read up on how OCI layers are structured better, but... could you help me out one last time, or point me to a doc where it makes a bit more sense so I structure my code better please? :) The question is, when do I use repos Resolve vs Blob.Resolve? :D |
Ah, so one lists blobs, and the other lists ManifestMediaTypes. So to list tags and such, I can use the repo Resolver to fetch things, but the actually get the blob data, I need to use |
@Skarlso The image-spec and the distribution-spec are what ORAS is following and are the source of truth.
Generally the API doc should help (just read it, LOL). But the pattern is that:
BTW, welcome to join the |
Not really, But it does not harm to explicitly specify the path if you know what you want. We would love to hear feedback on |
Ah thank you so much for the information!! That is a lot that can help here! :) Thank you! :) ❤️ ❤️ |
Basically what the title says.
I'm trying to resolve a layer like this but getting not found:
Yet when I run oras blob fetch, it's clearly there:
What am I doing wrong?
This is the manifest layer of that repo:
The text was updated successfully, but these errors were encountered: