Skip to content

Latest commit

 

History

History
118 lines (80 loc) · 3.81 KB

0115-rebase-immutable-image-ref.md

File metadata and controls

118 lines (80 loc) · 3.81 KB

Meta

Summary

Allow passing a digest reference as rebase target.

Definitions

An image reference refers to either a tag reference or digest reference.

A tag reference refers to an identifier of form <registry>/<repo>:<tag> which locates an image manifest in an OCI Distribution Specification compliant registry.

A digest reference refers to a content addressable identifier of form <registry>/<repo>@<digest> which locates an image manifest in an OCI Distribution Specification compliant registry.

Motivation

Enables rebasing by targeting an immutable image digest. There are some scenarios where the digest reference is preferred over tag reference.

What it is

This is a feature to expand the lifecycle rebase command to allow targeting an image by either tag or digest.

Today, lifecycle returns the following error when appempting to use a digest reference:

ERROR: failed to rebase: failed to write image to the following tags: [localhost:5003/foo/bar@sha256:916a9e100569ee521b86d03b8499b9b93d7d256d6e838868ae720295f2ea2f76: PUT http://localhost:5003/v2/foo/bar/manifests/sha256:916a9e100569ee521b86d03b8499b9b93d7d256d6e838868ae720295f2ea2f76: DIGEST_INVALID: provided digest did not match uploaded content]

This error could be avoided if digest references were permitted.

How it Works

Today, we can execute rebase by using tag references but not digest references.

Here are some examples of valid rebase commands. Tag is latest if not specified:

lifecycle rebase my-repo/foo
lifecycle rebase my-repo/foo:latest
lifecycle rebase my-repo/foo:v4

It is not currently possible to target an image using a digest reference.

The proposed feature will provide a mechanism to target an image rebase by tag reference or digest reference.

Here is what targeting an image via digest will look like:

lifecycle rebase -previous-image my-repo/foo@sha256:1234 -tag my-repo/foo:rebase my-repo/foo
  • When using a digest reference as the image target, the caller may specify zero or more <tag references> to apply to exported image. If no tag is provided, latest will be used.
  • If -previous-image is not provided, it is infered from the first argument. This is similar behavior to analyzer, for instance.

Migration

This is backwards compatible.

Drawbacks

Alternatives

Prior Art

pack explicitly does not support this. There is a friendly validation message in pack:

<rebase target> is not a tag reference

Unresolved Questions

Spec. Changes (OPTIONAL)

History