You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In an oci.Store, if a manifest m has its entry in the index.json file. Using Store.Tag with the digest as the reference will remove m from index.json file.
Run below go file to reproduce the issue. oras-go version: v2.0.1.
package main
import (
"context"
_ "crypto/sha256""fmt""os""path/filepath""strings""github.com/opencontainers/go-digest"
ocispec "github.com/opencontainers/image-spec/specs-go/v1""oras.land/oras-go/v2/content/oci"
)
funcmain() {
// prepareroot:=os.TempDir()
deferos.RemoveAll(root)
oci, err:=oci.New(root)
iferr!=nil {
panic(err)
}
ctx:=context.Background()
manifestContent:=`{"schemaVersion":2,"mediaType":"application/vnd.oci.image.manifest.v1+json","config":{"mediaType":"application/vnd.oci.image.config.v1+json","digest":"sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a","size":2},"layers":[]}`desc:= ocispec.Descriptor{
Digest: digest.FromString(manifestContent),
Size: int64(len(manifestContent)),
MediaType: "application/vnd.oci.image.manifest.v1+json",
}
// push a manifestoci.Push(ctx, desc, strings.NewReader(manifestContent))
index, err:=os.ReadFile(filepath.Join(root, "index.json"))
iferr!=nil {
panic(err)
}
fmt.Println(">>>>>>>>>>> after pushing >>>>>>>>>>>>>>")
fmt.Println(string(index))
// tag the manifest with its digestoci.Tag(ctx, desc, desc.Digest.String())
index, err=os.ReadFile(filepath.Join(root, "index.json"))
iferr!=nil {
panic(err)
}
fmt.Println(">>>>>>>>>>> after tagging >>>>>>>>>>>>>>")
fmt.Println(string(index))
}
The text was updated successfully, but these errors were encountered:
qweeah
changed the title
manifest removed unexpected from the OCI layout index.json file
manifest removed unexpectly from the OCI layout index.json file
Mar 14, 2023
In an
oci.Store
, if a manifestm
has its entry in theindex.json
file. UsingStore.Tag
with the digest as the reference will removem
fromindex.json
file.Run below go file to reproduce the issue. oras-go version: v2.0.1.
The text was updated successfully, but these errors were encountered: