@@ -102,6 +102,10 @@ var _ = Describe("Reconciler", func() {
102
102
Name : to .StringPtr (resourceskus .MemoryGB ),
103
103
Value : to .StringPtr ("16" ),
104
104
},
105
+ {
106
+ Name : to .StringPtr (resourceskus .CPUArchitectureType ),
107
+ Value : to .StringPtr (resourceskus .X64 ),
108
+ },
105
109
},
106
110
},
107
111
{
@@ -120,6 +124,60 @@ var _ = Describe("Reconciler", func() {
120
124
Name : to .StringPtr (resourceskus .GPUs ),
121
125
Value : to .StringPtr ("4" ),
122
126
},
127
+ {
128
+ Name : to .StringPtr (resourceskus .CPUArchitectureType ),
129
+ Value : to .StringPtr (resourceskus .X64 ),
130
+ },
131
+ },
132
+ },
133
+ {
134
+ Name : to .StringPtr ("Standard_D4ps_v5" ),
135
+ ResourceType : to .StringPtr ("virtualMachines" ),
136
+ Capabilities : & []compute.ResourceSkuCapabilities {
137
+ {
138
+ Name : to .StringPtr (resourceskus .VCPUs ),
139
+ Value : to .StringPtr ("4" ),
140
+ },
141
+ {
142
+ Name : to .StringPtr (resourceskus .MemoryGB ),
143
+ Value : to .StringPtr ("16" ),
144
+ },
145
+ {
146
+ Name : to .StringPtr (resourceskus .CPUArchitectureType ),
147
+ Value : to .StringPtr (resourceskus .Arm64 ),
148
+ },
149
+ },
150
+ },
151
+ {
152
+ Name : to .StringPtr ("Standard_D4s_v3_wrong-arch" ),
153
+ ResourceType : to .StringPtr ("virtualMachines" ),
154
+ Capabilities : & []compute.ResourceSkuCapabilities {
155
+ {
156
+ Name : to .StringPtr (resourceskus .VCPUs ),
157
+ Value : to .StringPtr ("4" ),
158
+ },
159
+ {
160
+ Name : to .StringPtr (resourceskus .MemoryGB ),
161
+ Value : to .StringPtr ("16" ),
162
+ },
163
+ {
164
+ Name : to .StringPtr (resourceskus .CPUArchitectureType ),
165
+ Value : to .StringPtr ("wrong-arch" ),
166
+ },
167
+ },
168
+ },
169
+ {
170
+ Name : to .StringPtr ("Standard_D4s_v3_missing-arch" ),
171
+ ResourceType : to .StringPtr ("virtualMachines" ),
172
+ Capabilities : & []compute.ResourceSkuCapabilities {
173
+ {
174
+ Name : to .StringPtr (resourceskus .VCPUs ),
175
+ Value : to .StringPtr ("4" ),
176
+ },
177
+ {
178
+ Name : to .StringPtr (resourceskus .MemoryGB ),
179
+ Value : to .StringPtr ("16" ),
180
+ },
123
181
},
124
182
},
125
183
}, "centralus" )
@@ -190,6 +248,7 @@ var _ = Describe("Reconciler", func() {
190
248
cpuKey : "4" ,
191
249
memoryKey : "16384" ,
192
250
gpuKey : "0" ,
251
+ labelsKey : "kubernetes.io/arch=amd64" ,
193
252
},
194
253
expectedEvents : []string {},
195
254
}),
@@ -200,6 +259,7 @@ var _ = Describe("Reconciler", func() {
200
259
cpuKey : "24" ,
201
260
memoryKey : "229376" ,
202
261
gpuKey : "4" ,
262
+ labelsKey : "kubernetes.io/arch=amd64" ,
203
263
},
204
264
expectedEvents : []string {},
205
265
}),
@@ -215,6 +275,7 @@ var _ = Describe("Reconciler", func() {
215
275
cpuKey : "24" ,
216
276
memoryKey : "229376" ,
217
277
gpuKey : "4" ,
278
+ labelsKey : "kubernetes.io/arch=amd64" ,
218
279
},
219
280
expectedEvents : []string {},
220
281
}),
@@ -230,6 +291,39 @@ var _ = Describe("Reconciler", func() {
230
291
},
231
292
expectedEvents : []string {"FailedUpdate" },
232
293
}),
294
+ Entry ("with a Standard_D4ps_v5 (aarch64)" , reconcileTestCase {
295
+ vmSize : "Standard_D4ps_v5" ,
296
+ existingAnnotations : make (map [string ]string ),
297
+ expectedAnnotations : map [string ]string {
298
+ cpuKey : "4" ,
299
+ memoryKey : "16384" ,
300
+ gpuKey : "0" ,
301
+ labelsKey : "kubernetes.io/arch=arm64" ,
302
+ },
303
+ expectedEvents : []string {},
304
+ }),
305
+ Entry ("with a vmSize missing the architecture capability" , reconcileTestCase {
306
+ vmSize : "Standard_D4s_v3_missing-arch" ,
307
+ existingAnnotations : make (map [string ]string ),
308
+ expectedAnnotations : map [string ]string {
309
+ cpuKey : "4" ,
310
+ memoryKey : "16384" ,
311
+ gpuKey : "0" ,
312
+ labelsKey : "kubernetes.io/arch=amd64" ,
313
+ },
314
+ expectedEvents : []string {},
315
+ }),
316
+ Entry ("with a vmSize missing an unknown architecture" , reconcileTestCase {
317
+ vmSize : "Standard_D4s_v3_wrong-arch" ,
318
+ existingAnnotations : make (map [string ]string ),
319
+ expectedAnnotations : map [string ]string {
320
+ cpuKey : "4" ,
321
+ memoryKey : "16384" ,
322
+ gpuKey : "0" ,
323
+ labelsKey : "kubernetes.io/arch=amd64" ,
324
+ },
325
+ expectedEvents : []string {},
326
+ }),
233
327
)
234
328
})
235
329
0 commit comments