Many registries implement support for tag immutability. In order to write tests that
rely on that behaviour, it would be useful to support it in ocimem.
Proposed new API:
package ocimem
// NewWithConfig returns a new in-memory [ociregistry.Interface]
// implementation using the given configuration. If
// cfg is nil, it's treated the same as a pointer to the zero [Config] value.
func NewWithConfig(cfg0 *Config) *Registry
// Config holds configuration for the registry.
type Config struct {
// ImmutableTags specifies that tags in the registry cannot
// be changed. Specifically the following restrictions are enforced:
// - no deletion of tagged manifests or any blob that a tagged manifest
// refers to.
// - no removal of tags from a manifest
// - no pushing of a tag if that tag already exists, even if it has
// the same digest.
ImmutableTags bool
}
This is backward compatible and leaves the door open for more configuration options.
Many registries implement support for tag immutability. In order to write tests that rely on that behaviour, it would be useful to support it in
ocimem
.Proposed new API:
This is backward compatible and leaves the door open for more configuration options.