forked from docker-java/docker-java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSELContext.java
More file actions
45 lines (37 loc) · 956 Bytes
/
Copy pathSELContext.java
File metadata and controls
45 lines (37 loc) · 956 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package com.github.dockerjava.api.model;
/**
* The context mode of bound volume in SELinux.
* Host path <code>shared</code> - can be used by all containers, <code>private</code> - by only this container
*
* @see http://www.projectatomic.io/blog/2015/06/using-volumes-with-docker-can-cause-problems-with-selinux/
* @since 1.17
*/
public enum SELContext {
/** no selinux */
none(""),
/** z option */
shared("z"),
/** Z option */
single("Z");
/**
* The default {@link SELContext}: {@link #none}
*/
public static final SELContext DEFAULT = none;
private String value;
SELContext(String v) {
this.value = v;
}
@Override
public String toString() {
return value;
}
public static SELContext fromString(String p) {
switch (p) {
case "z":
return shared;
case "Z":
return single;
}
return none;
}
}