|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "[TechPreview] IrreconcilableMachineConfig" |
| 3 | +crdName: machineconfignodes.machineconfiguration.openshift.io |
| 4 | +featureGates: |
| 5 | +- MachineConfigNodes |
| 6 | +- IrreconcilableMachineConfig |
| 7 | +tests: |
| 8 | + onUpdate: |
| 9 | + - name: Should be able to update a MachineConfigNode with a minimal irreconcilableChanges status field. |
| 10 | + initial: | |
| 11 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 12 | + kind: MachineConfigNode |
| 13 | + metadata: |
| 14 | + name: foobar |
| 15 | + spec: |
| 16 | + node: |
| 17 | + name: foobar |
| 18 | + pool: |
| 19 | + name: worker |
| 20 | + configVersion: |
| 21 | + desired: rendered-worker-abc |
| 22 | + updated: | |
| 23 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 24 | + kind: MachineConfigNode |
| 25 | + metadata: |
| 26 | + name: foobar |
| 27 | + spec: |
| 28 | + node: |
| 29 | + name: foobar |
| 30 | + pool: |
| 31 | + name: worker |
| 32 | + configVersion: |
| 33 | + desired: rendered-worker-abc |
| 34 | + status: |
| 35 | + irreconcilableChanges: |
| 36 | + - fieldPath: spec.config.storage.disks[0] |
| 37 | + diff: "dif content" |
| 38 | + expected: | |
| 39 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 40 | + kind: MachineConfigNode |
| 41 | + metadata: |
| 42 | + name: foobar |
| 43 | + spec: |
| 44 | + node: |
| 45 | + name: foobar |
| 46 | + pool: |
| 47 | + name: worker |
| 48 | + configVersion: |
| 49 | + desired: rendered-worker-abc |
| 50 | + status: |
| 51 | + irreconcilableChanges: |
| 52 | + - fieldPath: spec.config.storage.disks[0] |
| 53 | + diff: "dif content" |
| 54 | + - name: Should be able to update a MachineConfigNode to remove the irreconcilableChanges status field. |
| 55 | + initial: | |
| 56 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 57 | + kind: MachineConfigNode |
| 58 | + metadata: |
| 59 | + name: foobar |
| 60 | + spec: |
| 61 | + node: |
| 62 | + name: foobar |
| 63 | + pool: |
| 64 | + name: worker |
| 65 | + configVersion: |
| 66 | + desired: rendered-worker-abc |
| 67 | + status: |
| 68 | + irreconcilableChanges: |
| 69 | + - fieldPath: spec.config.storage.disks[0] |
| 70 | + diff: "dif content" |
| 71 | + updated: | |
| 72 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 73 | + kind: MachineConfigNode |
| 74 | + metadata: |
| 75 | + name: foobar |
| 76 | + spec: |
| 77 | + node: |
| 78 | + name: foobar |
| 79 | + pool: |
| 80 | + name: worker |
| 81 | + configVersion: |
| 82 | + desired: rendered-worker-abc |
| 83 | + status: {} |
| 84 | + expected: | |
| 85 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 86 | + kind: MachineConfigNode |
| 87 | + metadata: |
| 88 | + name: foobar |
| 89 | + spec: |
| 90 | + node: |
| 91 | + name: foobar |
| 92 | + pool: |
| 93 | + name: worker |
| 94 | + configVersion: |
| 95 | + desired: rendered-worker-abc |
| 96 | + status: {} |
| 97 | +
|
| 98 | + - name: Should not be able to set a fieldPath that does not start with spec. prefix in the irreconcilableChanges status field. |
| 99 | + initial: | |
| 100 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 101 | + kind: MachineConfigNode |
| 102 | + metadata: |
| 103 | + name: foobar |
| 104 | + spec: |
| 105 | + node: |
| 106 | + name: foobar |
| 107 | + pool: |
| 108 | + name: worker |
| 109 | + configVersion: |
| 110 | + desired: rendered-worker-abc |
| 111 | + status: |
| 112 | + irreconcilableChanges: |
| 113 | + - fieldPath: spec.config.storage.disks[0] |
| 114 | + diff: "dif content" |
| 115 | + updated: | |
| 116 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 117 | + kind: MachineConfigNode |
| 118 | + metadata: |
| 119 | + name: foobar |
| 120 | + spec: |
| 121 | + node: |
| 122 | + name: foobar |
| 123 | + pool: |
| 124 | + name: worker |
| 125 | + configVersion: |
| 126 | + desired: rendered-worker-abc |
| 127 | + status: |
| 128 | + irreconcilableChanges: |
| 129 | + - fieldPath: spec.config.storage.disks[0] |
| 130 | + diff: "dif content" |
| 131 | + - fieldPath: an.invalid.path |
| 132 | + diff: "dif content" |
| 133 | + expectedStatusError: "status.irreconcilableChanges[1].fieldPath: Invalid value: \"string\": The fieldPath must start with `spec.`" |
| 134 | + |
| 135 | + - name: Should not be able to set a fieldPath with invalid characters in the irreconcilableChanges status field. |
| 136 | + initial: | |
| 137 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 138 | + kind: MachineConfigNode |
| 139 | + metadata: |
| 140 | + name: foobar |
| 141 | + spec: |
| 142 | + node: |
| 143 | + name: foobar |
| 144 | + pool: |
| 145 | + name: worker |
| 146 | + configVersion: |
| 147 | + desired: rendered-worker-abc |
| 148 | + status: |
| 149 | + irreconcilableChanges: |
| 150 | + - fieldPath: spec.config.storage.disks[0] |
| 151 | + diff: "dif content" |
| 152 | + updated: | |
| 153 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 154 | + kind: MachineConfigNode |
| 155 | + metadata: |
| 156 | + name: foobar |
| 157 | + spec: |
| 158 | + node: |
| 159 | + name: foobar |
| 160 | + pool: |
| 161 | + name: worker |
| 162 | + configVersion: |
| 163 | + desired: rendered-worker-abc |
| 164 | + status: |
| 165 | + irreconcilableChanges: |
| 166 | + - fieldPath: spec.config.storage.disks[0] |
| 167 | + diff: "dif content" |
| 168 | + - fieldPath: spec.config@field{1} |
| 169 | + diff: "dif content" |
| 170 | + expectedStatusError: "status.irreconcilableChanges[1].fieldPath: Invalid value: \"string\": The fieldPath must consist only of alphanumeric characters, brackets [] and dots ('.')." |
| 171 | + |
| 172 | + - name: Should not be able to set set multiple diff elements for the same path in the irreconcilableChanges status field. |
| 173 | + initial: | |
| 174 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 175 | + kind: MachineConfigNode |
| 176 | + metadata: |
| 177 | + name: foobar |
| 178 | + spec: |
| 179 | + node: |
| 180 | + name: foobar |
| 181 | + pool: |
| 182 | + name: worker |
| 183 | + configVersion: |
| 184 | + desired: rendered-worker-abc |
| 185 | + status: |
| 186 | + irreconcilableChanges: |
| 187 | + - fieldPath: spec.config.storage.disks[0] |
| 188 | + diff: "dif content" |
| 189 | + updated: | |
| 190 | + apiVersion: machineconfiguration.openshift.io/v1 |
| 191 | + kind: MachineConfigNode |
| 192 | + metadata: |
| 193 | + name: foobar |
| 194 | + spec: |
| 195 | + node: |
| 196 | + name: foobar |
| 197 | + pool: |
| 198 | + name: worker |
| 199 | + configVersion: |
| 200 | + desired: rendered-worker-abc |
| 201 | + status: |
| 202 | + irreconcilableChanges: |
| 203 | + - fieldPath: spec.config.storage.disks[0] |
| 204 | + diff: "dif content" |
| 205 | + - fieldPath: spec.config.storage.disks[0] |
| 206 | + diff: "dif content updated" |
| 207 | + expectedStatusError: "status.irreconcilableChanges[1]: Duplicate value: map[string]interface {}{\"fieldPath\":\"spec.config.storage.disks[0]\"}" |
0 commit comments