|
| 1 | +apiVersion: apiextensions.k8s.io/v1 # Hack because controller-gen complains if we don't have this |
| 2 | +name: "Infrastructure" |
| 3 | +crdName: infrastructures.config.openshift.io |
| 4 | +featureGates: |
| 5 | +- AzureClusterHostedDNSInstall |
| 6 | +tests: |
| 7 | + onCreate: |
| 8 | + - name: Should be able to create a minimal Infrastructure |
| 9 | + initial: | |
| 10 | + apiVersion: config.openshift.io/v1 |
| 11 | + kind: Infrastructure |
| 12 | + spec: {} # No spec is required for a Infrastructure |
| 13 | + expected: | |
| 14 | + apiVersion: config.openshift.io/v1 |
| 15 | + kind: Infrastructure |
| 16 | + spec: {} |
| 17 | + onUpdate: |
| 18 | + - name: dnsType should default to `PlatformDefault` when not specified |
| 19 | + initial: | |
| 20 | + apiVersion: config.openshift.io/v1 |
| 21 | + kind: Infrastructure |
| 22 | + spec: |
| 23 | + platformSpec: |
| 24 | + azure: {} |
| 25 | + type: Azure |
| 26 | + status: |
| 27 | + controlPlaneTopology: HighlyAvailable |
| 28 | + infrastructureTopology: HighlyAvailable |
| 29 | + platform: Azure |
| 30 | + platformStatus: |
| 31 | + azure: {} |
| 32 | + type: Azure |
| 33 | + updated: | |
| 34 | + apiVersion: config.openshift.io/v1 |
| 35 | + kind: Infrastructure |
| 36 | + spec: |
| 37 | + platformSpec: |
| 38 | + type: Azure |
| 39 | + azure: {} |
| 40 | + status: |
| 41 | + controlPlaneTopology: HighlyAvailable |
| 42 | + infrastructureTopology: HighlyAvailable |
| 43 | + platform: Azure |
| 44 | + platformStatus: |
| 45 | + azure: {} |
| 46 | + type: Azure |
| 47 | + expected: | |
| 48 | + apiVersion: config.openshift.io/v1 |
| 49 | + kind: Infrastructure |
| 50 | + spec: |
| 51 | + platformSpec: |
| 52 | + type: Azure |
| 53 | + azure: {} |
| 54 | + status: |
| 55 | + controlPlaneTopology: HighlyAvailable |
| 56 | + cpuPartitioning: None |
| 57 | + infrastructureTopology: HighlyAvailable |
| 58 | + platform: Azure |
| 59 | + platformStatus: |
| 60 | + azure: |
| 61 | + cloudLoadBalancerConfig: |
| 62 | + dnsType: PlatformDefault |
| 63 | + type: Azure |
| 64 | + - name: should be able to set dnsType to non-default value of `ClusterHosted` |
| 65 | + initial: | |
| 66 | + apiVersion: config.openshift.io/v1 |
| 67 | + kind: Infrastructure |
| 68 | + spec: |
| 69 | + platformSpec: |
| 70 | + azure: {} |
| 71 | + type: Azure |
| 72 | + updated: | |
| 73 | + apiVersion: config.openshift.io/v1 |
| 74 | + kind: Infrastructure |
| 75 | + spec: |
| 76 | + platformSpec: |
| 77 | + type: Azure |
| 78 | + azure: {} |
| 79 | + status: |
| 80 | + controlPlaneTopology: HighlyAvailable |
| 81 | + infrastructureTopology: HighlyAvailable |
| 82 | + platform: Azure |
| 83 | + platformStatus: |
| 84 | + azure: |
| 85 | + cloudLoadBalancerConfig: |
| 86 | + dnsType: ClusterHosted |
| 87 | + type: Azure |
| 88 | + expected: | |
| 89 | + apiVersion: config.openshift.io/v1 |
| 90 | + kind: Infrastructure |
| 91 | + spec: |
| 92 | + platformSpec: |
| 93 | + type: Azure |
| 94 | + azure: {} |
| 95 | + status: |
| 96 | + controlPlaneTopology: HighlyAvailable |
| 97 | + cpuPartitioning: None |
| 98 | + infrastructureTopology: HighlyAvailable |
| 99 | + platform: Azure |
| 100 | + platformStatus: |
| 101 | + azure: |
| 102 | + cloudLoadBalancerConfig: |
| 103 | + dnsType: ClusterHosted |
| 104 | + type: Azure |
| 105 | + - name: Should not allow changing the immutable dnsType field |
| 106 | + initial: | |
| 107 | + apiVersion: config.openshift.io/v1 |
| 108 | + kind: Infrastructure |
| 109 | + spec: |
| 110 | + platformSpec: |
| 111 | + azure: {} |
| 112 | + type: Azure |
| 113 | + status: |
| 114 | + controlPlaneTopology: HighlyAvailable |
| 115 | + infrastructureTopology: HighlyAvailable |
| 116 | + platform: Azure |
| 117 | + platformStatus: |
| 118 | + azure: |
| 119 | + cloudLoadBalancerConfig: |
| 120 | + dnsType: ClusterHosted |
| 121 | + clusterHosted: |
| 122 | + apiIntLoadBalancerIPs: |
| 123 | + - 10.10.10.20 |
| 124 | + type: Azure |
| 125 | + updated: | |
| 126 | + apiVersion: config.openshift.io/v1 |
| 127 | + kind: Infrastructure |
| 128 | + spec: |
| 129 | + platformSpec: |
| 130 | + type: Azure |
| 131 | + azure: {} |
| 132 | + status: |
| 133 | + controlPlaneTopology: HighlyAvailable |
| 134 | + infrastructureTopology: HighlyAvailable |
| 135 | + platform: Azure |
| 136 | + platformStatus: |
| 137 | + azure: |
| 138 | + cloudLoadBalancerConfig: |
| 139 | + dnsType: PlatformDefault |
| 140 | + type: Azure |
| 141 | + expectedStatusError: "status.platformStatus.azure.cloudLoadBalancerConfig.dnsType: Invalid value: \"string\": dnsType is immutable" |
| 142 | + - name: Should not accept non-IP address values for Load Balancer IPs |
| 143 | + initial: | |
| 144 | + apiVersion: config.openshift.io/v1 |
| 145 | + kind: Infrastructure |
| 146 | + spec: |
| 147 | + platformSpec: |
| 148 | + azure: {} |
| 149 | + type: Azure |
| 150 | + status: |
| 151 | + controlPlaneTopology: HighlyAvailable |
| 152 | + infrastructureTopology: HighlyAvailable |
| 153 | + platform: Azure |
| 154 | + platformStatus: |
| 155 | + azure: |
| 156 | + cloudLoadBalancerConfig: |
| 157 | + dnsType: ClusterHosted |
| 158 | + clusterHosted: |
| 159 | + apiIntLoadBalancerIPs: |
| 160 | + - 10.10.10.20 |
| 161 | + type: Azure |
| 162 | + updated: | |
| 163 | + apiVersion: config.openshift.io/v1 |
| 164 | + kind: Infrastructure |
| 165 | + spec: |
| 166 | + platformSpec: |
| 167 | + type: Azure |
| 168 | + azure: {} |
| 169 | + status: |
| 170 | + controlPlaneTopology: HighlyAvailable |
| 171 | + infrastructureTopology: HighlyAvailable |
| 172 | + platform: Azure |
| 173 | + platformStatus: |
| 174 | + azure: |
| 175 | + cloudLoadBalancerConfig: |
| 176 | + dnsType: ClusterHosted |
| 177 | + clusterHosted: |
| 178 | + apiIntLoadBalancerIPs: |
| 179 | + - 10.10.10.20 |
| 180 | + - not-an-ip-address |
| 181 | + type: Azure |
| 182 | + expectedStatusError: "status.platformStatus.azure.cloudLoadBalancerConfig.clusterHosted.apiIntLoadBalancerIPs[1]: Invalid value: \"string\": value must be a valid IP address" |
| 183 | + - name: Should not accept update when `clusterHosted` is specified with DNSType `PlatformDefault` |
| 184 | + initial: | |
| 185 | + apiVersion: config.openshift.io/v1 |
| 186 | + kind: Infrastructure |
| 187 | + spec: |
| 188 | + platformSpec: |
| 189 | + azure: {} |
| 190 | + type: Azure |
| 191 | + status: |
| 192 | + controlPlaneTopology: HighlyAvailable |
| 193 | + infrastructureTopology: HighlyAvailable |
| 194 | + platform: Azure |
| 195 | + platformStatus: |
| 196 | + azure: {} |
| 197 | + type: Azure |
| 198 | + updated: | |
| 199 | + apiVersion: config.openshift.io/v1 |
| 200 | + kind: Infrastructure |
| 201 | + spec: |
| 202 | + platformSpec: |
| 203 | + type: Azure |
| 204 | + azure: {} |
| 205 | + status: |
| 206 | + controlPlaneTopology: HighlyAvailable |
| 207 | + infrastructureTopology: HighlyAvailable |
| 208 | + platform: Azure |
| 209 | + platformStatus: |
| 210 | + azure: |
| 211 | + cloudLoadBalancerConfig: |
| 212 | + dnsType: PlatformDefault |
| 213 | + clusterHosted: |
| 214 | + apiIntLoadBalancerIPs: |
| 215 | + - 10.10.10.20 |
| 216 | + type: Azure |
| 217 | + expectedStatusError: "status.platformStatus.azure.cloudLoadBalancerConfig: Invalid value: \"object\": clusterHosted is permitted only when dnsType is ClusterHosted" |
| 218 | + - name: Should not accept duplicate IP addresses for any of the Load Balancer IPs |
| 219 | + initial: | |
| 220 | + apiVersion: config.openshift.io/v1 |
| 221 | + kind: Infrastructure |
| 222 | + spec: |
| 223 | + platformSpec: |
| 224 | + azure: {} |
| 225 | + type: Azure |
| 226 | + updated: | |
| 227 | + apiVersion: config.openshift.io/v1 |
| 228 | + kind: Infrastructure |
| 229 | + spec: |
| 230 | + platformSpec: |
| 231 | + type: Azure |
| 232 | + azure: {} |
| 233 | + status: |
| 234 | + controlPlaneTopology: HighlyAvailable |
| 235 | + infrastructureTopology: HighlyAvailable |
| 236 | + platform: Azure |
| 237 | + platformStatus: |
| 238 | + azure: |
| 239 | + cloudLoadBalancerConfig: |
| 240 | + dnsType: ClusterHosted |
| 241 | + clusterHosted: |
| 242 | + apiIntLoadBalancerIPs: |
| 243 | + - 10.10.10.20 |
| 244 | + - 10.10.20.20 |
| 245 | + - 10.10.10.20 |
| 246 | + type: Azure |
| 247 | + expectedStatusError: "status.platformStatus.azure.cloudLoadBalancerConfig.clusterHosted.apiIntLoadBalancerIPs[2]: Duplicate value: \"10.10.10.20\"" |
0 commit comments