|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "SecurityContextConstraints" |
| 3 | +crdName: securitycontextconstraints.security.openshift.io |
| 4 | +featureGates: |
| 5 | +- UserNamespacesPodSecurityStandards |
| 6 | +tests: |
| 7 | + onCreate: |
| 8 | + - name: Should be able to create a minimal SecurityContextConstraints with featuregate enabled |
| 9 | + initial: | |
| 10 | + apiVersion: security.openshift.io/v1 |
| 11 | + kind: SecurityContextConstraints |
| 12 | + allowHostDirVolumePlugin: false |
| 13 | + allowHostIPC: false |
| 14 | + allowHostNetwork: false |
| 15 | + allowHostPID: false |
| 16 | + allowHostPorts: false |
| 17 | + allowPrivilegedContainer: false |
| 18 | + allowedCapabilities: [] |
| 19 | + defaultAddCapabilities: [] |
| 20 | + priority: 0 |
| 21 | + readOnlyRootFilesystem: false |
| 22 | + requiredDropCapabilities: [] |
| 23 | + volumes: [] |
| 24 | + expected: | |
| 25 | + apiVersion: security.openshift.io/v1 |
| 26 | + kind: SecurityContextConstraints |
| 27 | + allowHostDirVolumePlugin: false |
| 28 | + allowHostIPC: false |
| 29 | + allowHostNetwork: false |
| 30 | + allowHostPID: false |
| 31 | + allowHostPorts: false |
| 32 | + allowPrivilegedContainer: false |
| 33 | + allowedCapabilities: [] |
| 34 | + defaultAddCapabilities: [] |
| 35 | + priority: 0 |
| 36 | + readOnlyRootFilesystem: false |
| 37 | + requiredDropCapabilities: [] |
| 38 | + userNamespaceLevel: "AllowHostLevel" |
| 39 | + volumes: [] |
| 40 | +
|
| 41 | + - name: Should be able to set userNamespaceLevel to AllowHostLevel |
| 42 | + initial: | |
| 43 | + apiVersion: security.openshift.io/v1 |
| 44 | + kind: SecurityContextConstraints |
| 45 | + userNamespaceLevel: "AllowHostLevel" |
| 46 | + allowHostDirVolumePlugin: false |
| 47 | + allowHostIPC: false |
| 48 | + allowHostNetwork: false |
| 49 | + allowHostPID: false |
| 50 | + allowHostPorts: false |
| 51 | + allowPrivilegedContainer: false |
| 52 | + allowedCapabilities: [] |
| 53 | + defaultAddCapabilities: [] |
| 54 | + priority: 0 |
| 55 | + readOnlyRootFilesystem: false |
| 56 | + requiredDropCapabilities: [] |
| 57 | + volumes: [] |
| 58 | + expected: | |
| 59 | + apiVersion: security.openshift.io/v1 |
| 60 | + kind: SecurityContextConstraints |
| 61 | + userNamespaceLevel: "AllowHostLevel" |
| 62 | + allowHostDirVolumePlugin: false |
| 63 | + allowHostIPC: false |
| 64 | + allowHostNetwork: false |
| 65 | + allowHostPID: false |
| 66 | + allowHostPorts: false |
| 67 | + allowPrivilegedContainer: false |
| 68 | + allowedCapabilities: [] |
| 69 | + defaultAddCapabilities: [] |
| 70 | + priority: 0 |
| 71 | + readOnlyRootFilesystem: false |
| 72 | + requiredDropCapabilities: [] |
| 73 | + volumes: [] |
| 74 | +
|
| 75 | + - name: Should be able to set userNamespaceLevel to RequirePodLevel |
| 76 | + initial: | |
| 77 | + apiVersion: security.openshift.io/v1 |
| 78 | + kind: SecurityContextConstraints |
| 79 | + userNamespaceLevel: "RequirePodLevel" |
| 80 | + allowHostDirVolumePlugin: false |
| 81 | + allowHostIPC: false |
| 82 | + allowHostNetwork: false |
| 83 | + allowHostPID: false |
| 84 | + allowHostPorts: false |
| 85 | + allowPrivilegedContainer: false |
| 86 | + allowedCapabilities: [] |
| 87 | + defaultAddCapabilities: [] |
| 88 | + priority: 0 |
| 89 | + readOnlyRootFilesystem: false |
| 90 | + requiredDropCapabilities: [] |
| 91 | + volumes: [] |
| 92 | + expected: | |
| 93 | + apiVersion: security.openshift.io/v1 |
| 94 | + kind: SecurityContextConstraints |
| 95 | + userNamespaceLevel: "RequirePodLevel" |
| 96 | + allowHostDirVolumePlugin: false |
| 97 | + allowHostIPC: false |
| 98 | + allowHostNetwork: false |
| 99 | + allowHostPID: false |
| 100 | + allowHostPorts: false |
| 101 | + allowPrivilegedContainer: false |
| 102 | + allowedCapabilities: [] |
| 103 | + defaultAddCapabilities: [] |
| 104 | + priority: 0 |
| 105 | + readOnlyRootFilesystem: false |
| 106 | + requiredDropCapabilities: [] |
| 107 | + volumes: [] |
0 commit comments