Closed softpuff closed 4 months ago
Hi @softpuff , would you mind providing more context for reproducing this issue and describe the desired response?
Hi @FeynmanZhou, when I do several pushes of the same files a few times in a row digest returned is always different. I've looked at source code and I think timestamp in annotation is part of digest and because of that it's actually always the same. Is it possible to have the same digest every time when pushing the same content? Thanks
Is it possible to have the same digest every time when pushing the same content
@softpuff Yes, it is possible. All you need is to overwrite the ocispec.AnnotationCreated
annotation with the desired timestamp. Detailed example can be found at https://pkg.go.dev/oras.land/oras-go/v2#example-PackManifest-ImageV11RC4 (v2.4.0
) or https://pkg.go.dev/oras.land/oras-go/v2@main#example-PackManifest-ImageV11 (main
branch)
Closing the issue as the solution has been provided
Discussed in https://github.com/oras-project/oras-go/discussions/703