Skip to content

Manifest Annotations

Making annotations in Go is as simple as modifying the Annotations field of the Descriptor struct objects before passing them to oras.Push() with or without the option oras.WithConfig().

The caller can pass the push option oras.WithConfigAnnotations() to make annotations to the default config. Similarly, the caller can pass the push option oras.WithManifestAnnotations() to make annotations to the manifest.

Retrieve Annotations

Retrieving the annotations of individual layers is as simple as reading the Annotations field of the Descriptor slice returned by oras.Pull().

For example:

_, files, err := oras.Pull(ctx, resolver, ref, store)
if err != nil {
    panic(err)
}
for _, file := range files {
    fmt.Println(file.Annotations)
}

Retrieving the annotations of the manifest and/or the config is currently not supported.


Last update: June 29, 2021