|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "KubeletConfig" |
| 3 | +crdName: kubeletconfigs.machineconfiguration.openshift.io |
| 4 | +tests: |
| 5 | + onCreate: |
| 6 | + # AutoSizingReserved tests |
| 7 | + - name: Should be able to set autoSizingReserved to true |
| 8 | + initial: | |
| 9 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 10 | + kind: KubeletConfig |
| 11 | + spec: |
| 12 | + autoSizingReserved: true |
| 13 | + expected: | |
| 14 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 15 | + kind: KubeletConfig |
| 16 | + spec: |
| 17 | + autoSizingReserved: true |
| 18 | + - name: Should be able to set autoSizingReserved to false |
| 19 | + initial: | |
| 20 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 21 | + kind: KubeletConfig |
| 22 | + spec: |
| 23 | + autoSizingReserved: false |
| 24 | + expected: | |
| 25 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 26 | + kind: KubeletConfig |
| 27 | + spec: |
| 28 | + autoSizingReserved: false |
| 29 | + - name: Should be able to omit autoSizingReserved |
| 30 | + initial: | |
| 31 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 32 | + kind: KubeletConfig |
| 33 | + spec: {} |
| 34 | + expected: | |
| 35 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 36 | + kind: KubeletConfig |
| 37 | + spec: {} |
| 38 | +
|
| 39 | + # LogLevel tests |
| 40 | + - name: Should be able to set logLevel to 2 |
| 41 | + initial: | |
| 42 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 43 | + kind: KubeletConfig |
| 44 | + spec: |
| 45 | + logLevel: 2 |
| 46 | + expected: | |
| 47 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 48 | + kind: KubeletConfig |
| 49 | + spec: |
| 50 | + logLevel: 2 |
| 51 | + - name: Should be able to set logLevel to 4 |
| 52 | + initial: | |
| 53 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 54 | + kind: KubeletConfig |
| 55 | + spec: |
| 56 | + logLevel: 4 |
| 57 | + expected: | |
| 58 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 59 | + kind: KubeletConfig |
| 60 | + spec: |
| 61 | + logLevel: 4 |
| 62 | + - name: Should be able to omit logLevel |
| 63 | + initial: | |
| 64 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 65 | + kind: KubeletConfig |
| 66 | + spec: {} |
| 67 | + expected: | |
| 68 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 69 | + kind: KubeletConfig |
| 70 | + spec: {} |
| 71 | +
|
| 72 | + # MachineConfigPoolSelector tests |
| 73 | + - name: Should be able to set machineConfigPoolSelector for worker pool |
| 74 | + initial: | |
| 75 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 76 | + kind: KubeletConfig |
| 77 | + spec: |
| 78 | + machineConfigPoolSelector: |
| 79 | + matchLabels: |
| 80 | + pools.operator.machineconfiguration.openshift.io/worker: "" |
| 81 | + expected: | |
| 82 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 83 | + kind: KubeletConfig |
| 84 | + spec: |
| 85 | + machineConfigPoolSelector: |
| 86 | + matchLabels: |
| 87 | + pools.operator.machineconfiguration.openshift.io/worker: "" |
| 88 | + - name: Should be able to set machineConfigPoolSelector for master pool |
| 89 | + initial: | |
| 90 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 91 | + kind: KubeletConfig |
| 92 | + spec: |
| 93 | + machineConfigPoolSelector: |
| 94 | + matchLabels: |
| 95 | + pools.operator.machineconfiguration.openshift.io/master: "" |
| 96 | + expected: | |
| 97 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 98 | + kind: KubeletConfig |
| 99 | + spec: |
| 100 | + machineConfigPoolSelector: |
| 101 | + matchLabels: |
| 102 | + pools.operator.machineconfiguration.openshift.io/master: "" |
| 103 | + - name: Should be able to omit machineConfigPoolSelector |
| 104 | + initial: | |
| 105 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 106 | + kind: KubeletConfig |
| 107 | + spec: {} |
| 108 | + expected: | |
| 109 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 110 | + kind: KubeletConfig |
| 111 | + spec: {} |
| 112 | +
|
| 113 | + # KubeletConfig tests |
| 114 | + - name: Should be able to set kubeletConfig with maxPods |
| 115 | + initial: | |
| 116 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 117 | + kind: KubeletConfig |
| 118 | + spec: |
| 119 | + kubeletConfig: |
| 120 | + maxPods: 250 |
| 121 | + expected: | |
| 122 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 123 | + kind: KubeletConfig |
| 124 | + spec: |
| 125 | + kubeletConfig: |
| 126 | + maxPods: 250 |
| 127 | + - name: Should be able to omit kubeletConfig |
| 128 | + initial: | |
| 129 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 130 | + kind: KubeletConfig |
| 131 | + spec: {} |
| 132 | + expected: | |
| 133 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 134 | + kind: KubeletConfig |
| 135 | + spec: {} |
| 136 | +
|
| 137 | + # Combined fields tests |
| 138 | + - name: Should be able to set multiple fields together |
| 139 | + initial: | |
| 140 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 141 | + kind: KubeletConfig |
| 142 | + spec: |
| 143 | + autoSizingReserved: true |
| 144 | + logLevel: 2 |
| 145 | + machineConfigPoolSelector: |
| 146 | + matchLabels: |
| 147 | + pools.operator.machineconfiguration.openshift.io/worker: "" |
| 148 | + kubeletConfig: |
| 149 | + maxPods: 250 |
| 150 | + expected: | |
| 151 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 152 | + kind: KubeletConfig |
| 153 | + spec: |
| 154 | + autoSizingReserved: true |
| 155 | + logLevel: 2 |
| 156 | + machineConfigPoolSelector: |
| 157 | + matchLabels: |
| 158 | + pools.operator.machineconfiguration.openshift.io/worker: "" |
| 159 | + kubeletConfig: |
| 160 | + maxPods: 250 |
| 161 | +
|
| 162 | + onUpdate: |
| 163 | + # AutoSizingReserved update tests |
| 164 | + - name: Should be able to update autoSizingReserved from true to false |
| 165 | + initial: | |
| 166 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 167 | + kind: KubeletConfig |
| 168 | + spec: |
| 169 | + autoSizingReserved: true |
| 170 | + updated: | |
| 171 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 172 | + kind: KubeletConfig |
| 173 | + spec: |
| 174 | + autoSizingReserved: false |
| 175 | + expected: | |
| 176 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 177 | + kind: KubeletConfig |
| 178 | + spec: |
| 179 | + autoSizingReserved: false |
| 180 | + - name: Should be able to update autoSizingReserved from false to true |
| 181 | + initial: | |
| 182 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 183 | + kind: KubeletConfig |
| 184 | + spec: |
| 185 | + autoSizingReserved: false |
| 186 | + updated: | |
| 187 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 188 | + kind: KubeletConfig |
| 189 | + spec: |
| 190 | + autoSizingReserved: true |
| 191 | + expected: | |
| 192 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 193 | + kind: KubeletConfig |
| 194 | + spec: |
| 195 | + autoSizingReserved: true |
| 196 | +
|
| 197 | + # LogLevel update tests |
| 198 | + - name: Should be able to update logLevel from 2 to 4 |
| 199 | + initial: | |
| 200 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 201 | + kind: KubeletConfig |
| 202 | + spec: |
| 203 | + logLevel: 2 |
| 204 | + updated: | |
| 205 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 206 | + kind: KubeletConfig |
| 207 | + spec: |
| 208 | + logLevel: 4 |
| 209 | + expected: | |
| 210 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 211 | + kind: KubeletConfig |
| 212 | + spec: |
| 213 | + logLevel: 4 |
| 214 | + - name: Should be able to remove logLevel |
| 215 | + initial: | |
| 216 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 217 | + kind: KubeletConfig |
| 218 | + spec: |
| 219 | + logLevel: 2 |
| 220 | + updated: | |
| 221 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 222 | + kind: KubeletConfig |
| 223 | + spec: {} |
| 224 | + expected: | |
| 225 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 226 | + kind: KubeletConfig |
| 227 | + spec: {} |
| 228 | +
|
| 229 | + # MachineConfigPoolSelector update tests |
| 230 | + - name: Should be able to update machineConfigPoolSelector from worker to master |
| 231 | + initial: | |
| 232 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 233 | + kind: KubeletConfig |
| 234 | + spec: |
| 235 | + machineConfigPoolSelector: |
| 236 | + matchLabels: |
| 237 | + pools.operator.machineconfiguration.openshift.io/worker: "" |
| 238 | + updated: | |
| 239 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 240 | + kind: KubeletConfig |
| 241 | + spec: |
| 242 | + machineConfigPoolSelector: |
| 243 | + matchLabels: |
| 244 | + pools.operator.machineconfiguration.openshift.io/master: "" |
| 245 | + expected: | |
| 246 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 247 | + kind: KubeletConfig |
| 248 | + spec: |
| 249 | + machineConfigPoolSelector: |
| 250 | + matchLabels: |
| 251 | + pools.operator.machineconfiguration.openshift.io/master: "" |
| 252 | +
|
| 253 | + # Combined update tests |
| 254 | + - name: Should be able to update multiple fields together |
| 255 | + initial: | |
| 256 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 257 | + kind: KubeletConfig |
| 258 | + spec: |
| 259 | + autoSizingReserved: false |
| 260 | + logLevel: 2 |
| 261 | + updated: | |
| 262 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 263 | + kind: KubeletConfig |
| 264 | + spec: |
| 265 | + autoSizingReserved: true |
| 266 | + logLevel: 4 |
| 267 | + kubeletConfig: |
| 268 | + maxPods: 250 |
| 269 | + expected: | |
| 270 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 271 | + kind: KubeletConfig |
| 272 | + spec: |
| 273 | + autoSizingReserved: true |
| 274 | + logLevel: 4 |
| 275 | + kubeletConfig: |
| 276 | + maxPods: 250 |
0 commit comments