Skip to content

Commit 6179d36

Browse files
authored
Merge pull request #317 from jonboulle/layer
layer: clarify wording around applying changesets
2 parents e66ad79 + 6281e22 commit 6179d36

File tree

1 file changed

+11
-13
lines changed

1 file changed

+11
-13
lines changed

layer.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -204,31 +204,29 @@ The resulting tar archive for `rootfs-c9d-v1.s1` has the following entries:
204204
./etc/.wh.my-app-config
205205
```
206206

207-
Where the basename name of `./etc/my-app-config` is now prefixed with `.wh.`, and will therefore be removed when the changeset is applied.
207+
To signify that the resource `./etc/my-app-config` MUST be removed when the changeset is applied, the basename of the entry is prefixed with `.wh.`.
208208

209-
## Applying
209+
## Applying Changesets
210210

211-
Layer Changesets of [mediatype](./media-types.md) `application/vnd.oci.image.layer.v1.tar+gzip` are applied rather than strictly extracted in normal fashion for tar archives.
211+
Layer Changesets of [mediatype](./media-types.md) `application/vnd.oci.image.layer.v1.tar+gzip` are _applied_, rather than simply extracted as tar archives.
212212

213-
Applying a layer changeset requires consideration for the [whiteout](#whiteouts) files.
214-
In the absence of any [whiteout](#whiteouts) files in a layer changeset, the archive is extracted like a regular tar archive.
213+
Applying a layer changeset requires special consideration for the [whiteout](#whiteouts) files.
215214

215+
In the absence of any [whiteout](#whiteouts) files in a layer changeset, the archive is extracted like a regular tar archive.
216216

217217
### Changeset over existing files
218218

219-
This section covers applying an entry in a layer changeset, if the file path already exists.
219+
This section specifies applying an entry from a layer changeset if the target path already exists.
220220

221-
If the file path is a directory, then the existing path just has it's attribute set from the layer changeset for that filepath.
222-
If the file path is any other file type (regular file, FIFO, etc), then the:
223-
* file path is unlinked (See [`unlink(2)`](http://linux.die.net/man/2/unlink))
224-
* create the file
225-
* If a regular file then content written.
226-
* set attributes on the filepath
221+
If the entry and the existing path are both directories, then the existing path's attributes MUST be replaced by those of the entry in the changeset.
222+
In all other cases, the implementation MUST do the semantic equivalent of the following:
223+
- removing the file path (e.g. [`unlink(2)`](http://linux.die.net/man/2/unlink) on Linux systems)
224+
- recreating the file path, based on the contents and attributes of the changeset entry
227225

228226
## Whiteouts
229227

230228
A whiteout file is an empty file with a special filename that signifies a path should be deleted.
231-
A whiteout filename consists of the prefix .wh. plus the basename of the path to be deleted.
229+
A whiteout filename consists of the prefix `.wh.` plus the basename of the path to be deleted.
232230
As files prefixed with `.wh.` are special whiteout markers, it is not possible to create a filesystem which has a file or directory with a name beginning with `.wh.`.
233231

234232
Once a whiteout is applied, the whiteout itself MUST also be hidden.

0 commit comments

Comments
 (0)