|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "IngressControllerConfig" |
| 3 | +crdName: ingresscontrollerconfigs.config.openshift.io |
| 4 | +featureGate: IngressControllerConfig |
| 5 | +tests: |
| 6 | + onCreate: |
| 7 | + - name: Should be able to create a minimal IngressControllerConfig |
| 8 | + initial: | |
| 9 | + apiVersion: config.openshift.io/v1alpha1 |
| 10 | + kind: IngressControllerConfig |
| 11 | + metadata: |
| 12 | + name: cluster |
| 13 | + spec: |
| 14 | + defaultControllerConfig: |
| 15 | + logLevel: Info |
| 16 | + expected: | |
| 17 | + apiVersion: config.openshift.io/v1alpha1 |
| 18 | + kind: IngressControllerConfig |
| 19 | + metadata: |
| 20 | + name: cluster |
| 21 | + spec: |
| 22 | + defaultControllerConfig: |
| 23 | + logLevel: Info |
| 24 | + - name: Should be able to create a comprehensive IngressControllerConfig |
| 25 | + initial: | |
| 26 | + apiVersion: config.openshift.io/v1alpha1 |
| 27 | + kind: IngressControllerConfig |
| 28 | + metadata: |
| 29 | + name: cluster |
| 30 | + spec: |
| 31 | + defaultControllerConfig: |
| 32 | + logLevel: Info |
| 33 | + nodeSelector: |
| 34 | + kubernetes.io/os: linux |
| 35 | + node-role.kubernetes.io/worker: "" |
| 36 | + resources: |
| 37 | + - name: cpu |
| 38 | + request: 100m |
| 39 | + - name: memory |
| 40 | + request: 256Mi |
| 41 | + limit: 512Mi |
| 42 | + replicas: 2 |
| 43 | + tolerations: |
| 44 | + - effect: NoSchedule |
| 45 | + key: node-role.kubernetes.io/worker |
| 46 | + operator: Exists |
| 47 | + performanceTuning: |
| 48 | + connectionLimits: |
| 49 | + maxConnections: 20000 |
| 50 | + maxConnectionsPerBackend: 100 |
| 51 | + maxRequestsPerConnection: 10 |
| 52 | + timeouts: |
| 53 | + clientTimeout: |
| 54 | + duration: "30s" |
| 55 | + serverTimeout: |
| 56 | + duration: "30s" |
| 57 | + connectTimeout: |
| 58 | + duration: "5s" |
| 59 | + bufferSizes: |
| 60 | + requestHeaderBufferSize: "8Ki" |
| 61 | + responseBufferSize: "32Ki" |
| 62 | + expected: | |
| 63 | + apiVersion: config.openshift.io/v1alpha1 |
| 64 | + kind: IngressControllerConfig |
| 65 | + metadata: |
| 66 | + name: cluster |
| 67 | + spec: |
| 68 | + defaultControllerConfig: |
| 69 | + logLevel: Info |
| 70 | + nodeSelector: |
| 71 | + kubernetes.io/os: linux |
| 72 | + node-role.kubernetes.io/worker: "" |
| 73 | + resources: |
| 74 | + - name: cpu |
| 75 | + request: 100m |
| 76 | + - name: memory |
| 77 | + request: 256Mi |
| 78 | + limit: 512Mi |
| 79 | + replicas: 2 |
| 80 | + tolerations: |
| 81 | + - effect: NoSchedule |
| 82 | + key: node-role.kubernetes.io/worker |
| 83 | + operator: Exists |
| 84 | + performanceTuning: |
| 85 | + connectionLimits: |
| 86 | + maxConnections: 20000 |
| 87 | + maxConnectionsPerBackend: 100 |
| 88 | + maxRequestsPerConnection: 10 |
| 89 | + timeouts: |
| 90 | + clientTimeout: |
| 91 | + duration: "30s" |
| 92 | + serverTimeout: |
| 93 | + duration: "30s" |
| 94 | + connectTimeout: |
| 95 | + duration: "5s" |
| 96 | + bufferSizes: |
| 97 | + requestHeaderBufferSize: "8Ki" |
| 98 | + responseBufferSize: "32Ki" |
| 99 | + - name: Should reject IngressControllerConfig with replicas below minimum |
| 100 | + initial: | |
| 101 | + apiVersion: config.openshift.io/v1alpha1 |
| 102 | + kind: IngressControllerConfig |
| 103 | + metadata: |
| 104 | + name: cluster |
| 105 | + spec: |
| 106 | + defaultControllerConfig: |
| 107 | + replicas: 0 |
| 108 | + expectedError: 'spec.defaultControllerConfig.replicas: Invalid value: 0: spec.defaultControllerConfig.replicas in body should be greater than or equal to 1' |
| 109 | + - name: Should reject IngressControllerConfig with replicas above maximum |
| 110 | + initial: | |
| 111 | + apiVersion: config.openshift.io/v1alpha1 |
| 112 | + kind: IngressControllerConfig |
| 113 | + metadata: |
| 114 | + name: cluster |
| 115 | + spec: |
| 116 | + defaultControllerConfig: |
| 117 | + replicas: 21 |
| 118 | + expectedError: 'spec.defaultControllerConfig.replicas: Invalid value: 21: spec.defaultControllerConfig.replicas in body should be less than or equal to 20' |
| 119 | + - name: Should reject ContainerResource with duplicate names |
| 120 | + initial: | |
| 121 | + apiVersion: config.openshift.io/v1alpha1 |
| 122 | + kind: IngressControllerConfig |
| 123 | + metadata: |
| 124 | + name: cluster |
| 125 | + spec: |
| 126 | + defaultControllerConfig: |
| 127 | + resources: |
| 128 | + - name: "cpu" |
| 129 | + request: "100m" |
| 130 | + - name: "cpu" |
| 131 | + request: "200m" |
| 132 | + expectedError: 'spec.defaultControllerConfig.resources[1]: Duplicate value: map[string]interface {}{"name":"cpu"}' |
| 133 | + - name: Should reject more than 50 tolerations |
| 134 | + initial: | |
| 135 | + apiVersion: config.openshift.io/v1alpha1 |
| 136 | + kind: IngressControllerConfig |
| 137 | + metadata: |
| 138 | + name: cluster |
| 139 | + spec: |
| 140 | + defaultControllerConfig: |
| 141 | + tolerations: |
| 142 | + - key: key-0 |
| 143 | + effect: NoSchedule |
| 144 | + - key: key-1 |
| 145 | + effect: NoSchedule |
| 146 | + - key: key-2 |
| 147 | + effect: NoSchedule |
| 148 | + - key: key-3 |
| 149 | + effect: NoSchedule |
| 150 | + - key: key-4 |
| 151 | + effect: NoSchedule |
| 152 | + - key: key-5 |
| 153 | + effect: NoSchedule |
| 154 | + - key: key-6 |
| 155 | + effect: NoSchedule |
| 156 | + - key: key-7 |
| 157 | + effect: NoSchedule |
| 158 | + - key: key-8 |
| 159 | + effect: NoSchedule |
| 160 | + - key: key-9 |
| 161 | + effect: NoSchedule |
| 162 | + - key: key-10 |
| 163 | + effect: NoSchedule |
| 164 | + - key: key-11 |
| 165 | + effect: NoSchedule |
| 166 | + - key: key-12 |
| 167 | + effect: NoSchedule |
| 168 | + - key: key-13 |
| 169 | + effect: NoSchedule |
| 170 | + - key: key-14 |
| 171 | + effect: NoSchedule |
| 172 | + - key: key-15 |
| 173 | + effect: NoSchedule |
| 174 | + - key: key-16 |
| 175 | + effect: NoSchedule |
| 176 | + - key: key-17 |
| 177 | + effect: NoSchedule |
| 178 | + - key: key-18 |
| 179 | + effect: NoSchedule |
| 180 | + - key: key-19 |
| 181 | + effect: NoSchedule |
| 182 | + - key: key-20 |
| 183 | + effect: NoSchedule |
| 184 | + - key: key-21 |
| 185 | + effect: NoSchedule |
| 186 | + - key: key-22 |
| 187 | + effect: NoSchedule |
| 188 | + - key: key-23 |
| 189 | + effect: NoSchedule |
| 190 | + - key: key-24 |
| 191 | + effect: NoSchedule |
| 192 | + - key: key-25 |
| 193 | + effect: NoSchedule |
| 194 | + - key: key-26 |
| 195 | + effect: NoSchedule |
| 196 | + - key: key-27 |
| 197 | + effect: NoSchedule |
| 198 | + - key: key-28 |
| 199 | + effect: NoSchedule |
| 200 | + - key: key-29 |
| 201 | + effect: NoSchedule |
| 202 | + - key: key-30 |
| 203 | + effect: NoSchedule |
| 204 | + - key: key-31 |
| 205 | + effect: NoSchedule |
| 206 | + - key: key-32 |
| 207 | + effect: NoSchedule |
| 208 | + - key: key-33 |
| 209 | + effect: NoSchedule |
| 210 | + - key: key-34 |
| 211 | + effect: NoSchedule |
| 212 | + - key: key-35 |
| 213 | + effect: NoSchedule |
| 214 | + - key: key-36 |
| 215 | + effect: NoSchedule |
| 216 | + - key: key-37 |
| 217 | + effect: NoSchedule |
| 218 | + - key: key-38 |
| 219 | + effect: NoSchedule |
| 220 | + - key: key-39 |
| 221 | + effect: NoSchedule |
| 222 | + - key: key-40 |
| 223 | + effect: NoSchedule |
| 224 | + - key: key-41 |
| 225 | + effect: NoSchedule |
| 226 | + - key: key-42 |
| 227 | + effect: NoSchedule |
| 228 | + - key: key-43 |
| 229 | + effect: NoSchedule |
| 230 | + - key: key-44 |
| 231 | + effect: NoSchedule |
| 232 | + - key: key-45 |
| 233 | + effect: NoSchedule |
| 234 | + - key: key-46 |
| 235 | + effect: NoSchedule |
| 236 | + - key: key-47 |
| 237 | + effect: NoSchedule |
| 238 | + - key: key-48 |
| 239 | + effect: NoSchedule |
| 240 | + - key: key-49 |
| 241 | + effect: NoSchedule |
| 242 | + - key: key-50 |
| 243 | + effect: NoSchedule |
| 244 | + - key: key-51 |
| 245 | + effect: NoSchedule |
| 246 | + expectedError: 'spec.defaultControllerConfig.tolerations: Too many: 51: must have at most 50 items' |
0 commit comments