Skip to content

Rename the scratch variable and layer requirements#1042

Merged
sajayantony merged 1 commit intoopencontainers:mainfrom
sudo-bmitch:pr-scratch-var
Apr 18, 2023
Merged

Rename the scratch variable and layer requirements#1042
sajayantony merged 1 commit intoopencontainers:mainfrom
sudo-bmitch:pr-scratch-var

Conversation

@sudo-bmitch
Copy link
Copy Markdown
Contributor

This covers a few nits with the scratch variable and documentation on its usage. It also clarifies that various requirements on the layer blobs only apply when the config media type specifies the content is an OCI Image (vs using the image manifest to package an artifact).

@sudo-bmitch sudo-bmitch added this to the v1.1 milestone Mar 28, 2023
imjasonh
imjasonh previously approved these changes Mar 30, 2023
@sudo-bmitch
Copy link
Copy Markdown
Contributor Author

I've updated with the requested changes.

Subsequent layers MUST then follow in stack order (i.e. from `layers[0]` to `layers[len(layers)-1]`).
The final filesystem layout MUST match the result of [applying](layer.md#applying-changesets) the layers to an empty directory.
The [ownership, mode, and other attributes](layer.md#file-attributes) of the initial empty directory are unspecified.
For portability, `layers` SHOULD have at least one entry.
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we're embracing the scratch blob to support scenarios that don't require a config, can we also use scratch to represent a layer for scenarios where users are adding annotations as a reference type?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that was part of the intent of the scratch descriptor.

@sajayantony
Copy link
Copy Markdown
Member

Linking the previos comment since we might want to come back to a struct - #1023 (comment)

@jonjohnsonjr
Copy link
Copy Markdown
Contributor

Assuming we have a static media type for scratch (https://github.com/opencontainers/image-spec/pull/1043/files#diff-787b938deb273ebe89950c4ff04dbcb072c4644e729ad4fb495265e24bcbfce4), I'd also like to move this to a single Descriptor we expose.

const ScratchDigestData = `{}`
const (
// ScratchDigestSHA256 is the digest of a blob with content of `{}` (size of 2).
ScratchDigestSHA256 = `sha256:44136fa355b3678a1146ad16f7e8649e94fb4fc21fe77e8310c060f61caaff8a`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO, if we keep this field, we should drop SHA256 from the end of it too, but as discussed in the call today, now that we have an explicit media type for scratch from #1043, we can probably revisit #1023 (comment) and have a proper Descriptor object again (and not really need a function for it).

Signed-off-by: Brandon Mitchell <git@bmitch.net>
@sudo-bmitch
Copy link
Copy Markdown
Contributor Author

This has been updated with the changes from today's meeting. PTAL.

@sajayantony sajayantony merged commit 933f917 into opencontainers:main Apr 18, 2023
@sudo-bmitch sudo-bmitch deleted the pr-scratch-var branch April 18, 2023 21:16
@tianon tianon mentioned this pull request May 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants