Use octal instead of decimal in examples (#8278)
This is a more readable way of doing permissions, since the examples use yaml.
This commit is contained in:
committed by
k8s-ci-robot
parent
3da5b0bce2
commit
dcfd0c3d8b
@@ -266,15 +266,14 @@ spec:
|
|||||||
- name: foo
|
- name: foo
|
||||||
secret:
|
secret:
|
||||||
secretName: mysecret
|
secretName: mysecret
|
||||||
defaultMode: 256
|
defaultMode: 0400
|
||||||
```
|
```
|
||||||
|
|
||||||
Then, the secret will be mounted on `/etc/foo` and all the files created by the
|
Then, the secret will be mounted on `/etc/foo` and all the files created by the
|
||||||
secret volume mount will have permission `0400`.
|
secret volume mount will have permission `0400`.
|
||||||
|
|
||||||
Note that the JSON spec doesn't support octal notation, so use the value 256 for
|
Note that the JSON spec doesn't support octal notation, so if you use json instead
|
||||||
0400 permissions. If you use yaml instead of json for the pod, you can use octal
|
of yaml for the pod, use the value 256 for 0400 permissions.
|
||||||
notation to specify permissions in a more natural way.
|
|
||||||
|
|
||||||
You can also use mapping, as in the previous example, and specify different
|
You can also use mapping, as in the previous example, and specify different
|
||||||
permission for different files like this:
|
permission for different files like this:
|
||||||
@@ -298,12 +297,11 @@ spec:
|
|||||||
items:
|
items:
|
||||||
- key: username
|
- key: username
|
||||||
path: my-group/my-username
|
path: my-group/my-username
|
||||||
mode: 511
|
mode: 0777
|
||||||
```
|
```
|
||||||
|
|
||||||
In this case, the file resulting in `/etc/foo/my-group/my-username` will have
|
In this case, the file resulting in `/etc/foo/my-group/my-username` will have
|
||||||
permission value of `0777`. Owing to JSON limitations, you must specify the mode
|
permission value of `0777`.
|
||||||
in decimal notation.
|
|
||||||
|
|
||||||
Note that this permission value might be displayed in decimal notation if you
|
Note that this permission value might be displayed in decimal notation if you
|
||||||
read it later.
|
read it later.
|
||||||
|
|||||||
@@ -670,7 +670,7 @@ spec:
|
|||||||
items:
|
items:
|
||||||
- key: password
|
- key: password
|
||||||
path: my-group/my-password
|
path: my-group/my-password
|
||||||
mode: 511
|
mode: 0777
|
||||||
```
|
```
|
||||||
|
|
||||||
Each projected volume source is listed in the spec under `sources`. The
|
Each projected volume source is listed in the spec under `sources`. The
|
||||||
|
|||||||
Reference in New Issue
Block a user