Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

types/volume: add recursive flag #630

Merged
merged 2 commits into from
Jul 6, 2016

Conversation

alban
Copy link
Member

@alban alban commented Jun 22, 2016

Closes #622.

  • Add Flag
  • Decide on default value
  • Tests

It is still "WIP" for now because I would like to test it first.

/cc @steveej @jonboulle

@alban alban mentioned this pull request Jun 22, 2016
3 tasks
@@ -172,6 +173,7 @@ JSON Schema for the Pod Manifest, conforming to [RFC4627](https://tools.ietf.org
* **volumes** (list of objects, optional) list of volumes which will be mounted into each application's filesystem
* **name** (string, required) descriptive label for the volume (restricted to the [AC Name](types.md#ac-name-type) formatting), used as an index by the `mounts` objects (above).
* **readOnly** (boolean, optional, defaults to "false" if unsupplied) whether or not the volume will be mounted read only.
* **recursive** (boolean, optional) whether or not the volume will be mounted recursively. When **recursive** is not specified, the executor SHOULD default to recursive. However, executors in specific run environment might prefer to default to non-recursive.
Copy link
Contributor

Choose a reason for hiding this comment

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

This only applies to kind = host right?

Copy link
Member Author

Choose a reason for hiding this comment

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

I guess so... I don't see what differences the recursive bool would make on an empty volume.

I will update the text to make it clearer.

@@ -172,6 +173,7 @@ JSON Schema for the Pod Manifest, conforming to [RFC4627](https://tools.ietf.org
* **volumes** (list of objects, optional) list of volumes which will be mounted into each application's filesystem
* **name** (string, required) descriptive label for the volume (restricted to the [AC Name](types.md#ac-name-type) formatting), used as an index by the `mounts` objects (above).
* **readOnly** (boolean, optional, defaults to "false" if unsupplied) whether or not the volume will be mounted read only.
* **recursive** (boolean, optional) whether or not the volume will be mounted recursively. This only applies to volumes of type **host**. Executors MUST ignore **recursive** on **empty** volumes. When **recursive** is not specified, the executor SHOULD default to recursive. However, executors in specific run environment might prefer to default to non-recursive.
Copy link
Contributor

@jonboulle jonboulle Jun 22, 2016

Choose a reason for hiding this comment

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

sorry, couple of things I should have mentioned on first pass:

  • s/type/kind/
  • can you move this after the kind entry? (i.e. before/after "source") - you can adopt similar language to mode/uid - "boolean, optional, only interpreted if kind is "host"" (then you can remove the ignore part you have now)
  • can you link to a reference to what recursive means?

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated.

I linked to an LWN article because I found that the mount manpage didn't really explain recursive bind mount. And the shared subtree document does not mention it either.

@jonboulle
Copy link
Contributor

ping?

@alban alban force-pushed the alban/volume-recursive branch 4 times, most recently from f3622a3 to 5957f48 Compare July 5, 2016 15:22
@alban alban changed the title [WIP] types/volume: add recursive flag types/volume: add recursive flag Jul 5, 2016
@alban
Copy link
Member Author

alban commented Jul 5, 2016

Updated.

I also added tests in volume_test.go.

@@ -175,6 +176,7 @@ JSON Schema for the Pod Manifest, conforming to [RFC4627](https://tools.ietf.org
* **kind** (string, required) either:
* **empty** - creates an empty directory on the host and bind mounts it into the container. All containers in the pod share the mount, and the lifetime of the volume is equal to the lifetime of the pod (i.e. the directory on the host machine is removed when the pod's filesystem is garbage collected)
* **host** - fulfills a mount point with a bind mount from a **source** directory on the host.
* **recursive** (boolean, optional, only interpreted if **kind** is "host") whether or not the volume will be mounted [recursively](http://lwn.net/Articles/690679/). When **recursive** is not specified, the executor SHOULD default to recursive. However, executors in specific run environment might prefer to default to non-recursive.
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this after "source"?

@jonboulle
Copy link
Contributor

One nit, lgtm other than that

@alban alban force-pushed the alban/volume-recursive branch from 5957f48 to ac3e4e5 Compare July 6, 2016 09:36
@alban
Copy link
Member Author

alban commented Jul 6, 2016

Updated.

@@ -176,6 +177,7 @@ JSON Schema for the Pod Manifest, conforming to [RFC4627](https://tools.ietf.org
* **empty** - creates an empty directory on the host and bind mounts it into the container. All containers in the pod share the mount, and the lifetime of the volume is equal to the lifetime of the pod (i.e. the directory on the host machine is removed when the pod's filesystem is garbage collected)
* **host** - fulfills a mount point with a bind mount from a **source** directory on the host.
* **source** (string, required if **kind** is "host") absolute path on host to be bind mounted under a mount point in each app's chroot.
* **recursive** (boolean, optional, only interpreted if **kind** is "host") whether or not the volume will be mounted [recursively](http://lwn.net/Articles/690679/). When **recursive** is not specified, the executor SHOULD default to recursive. However, executors in specific run environment might prefer to default to non-recursive.
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you just remove the last sentence? the grammar is slightly off but it's really superfluous since it's a SHOULD anyway.

@jonboulle
Copy link
Contributor

sorry, I didn't read proper good yesterday. One more nit..

@alban alban force-pushed the alban/volume-recursive branch from ac3e4e5 to 1ef8507 Compare July 6, 2016 14:14
@alban
Copy link
Member Author

alban commented Jul 6, 2016

Updated :)

steveej and others added 2 commits July 6, 2016 16:15
This includes a unit test.
The recursive field is a boolean. I set the default to true, but only
with a "SHOULD" (rfc2119):

> 3. SHOULD   This word, or the adjective "RECOMMENDED", mean that there
>    may exist valid reasons in particular circumstances to ignore a
>    particular item, but the full implications must be understood and
>    carefully weighed before choosing a different course.

See discussion on:
appc#622 (comment)
@jonboulle
Copy link
Contributor

thanks for your patience

@jonboulle jonboulle merged commit 520c908 into appc:master Jul 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants