@@ -281,6 +281,55 @@ func TestGeneratePlatformWorkloadIdentitySecrets(t *testing.T) {
281
281
roles : []api.PlatformWorkloadIdentityRole {},
282
282
want : []* corev1.Secret {},
283
283
},
284
+ {
285
+ name : "skips ARO operator identity" ,
286
+ identities : []api.PlatformWorkloadIdentity {
287
+ {
288
+ OperatorName : "foo" ,
289
+ ClientID : "00f00f00-0f00-0f00-0f00-f00f00f00f00" ,
290
+ },
291
+ {
292
+ OperatorName : "ServiceOperator" ,
293
+ ClientID : "00ba4ba4-0ba4-0ba4-0ba4-ba4ba4ba4ba4" ,
294
+ },
295
+ },
296
+ roles : []api.PlatformWorkloadIdentityRole {
297
+ {
298
+ OperatorName : "foo" ,
299
+ SecretLocation : api.SecretLocation {
300
+ Namespace : "openshift-foo" ,
301
+ Name : "azure-cloud-credentials" ,
302
+ },
303
+ },
304
+ {
305
+ OperatorName : "ServiceOperator" ,
306
+ SecretLocation : api.SecretLocation {
307
+ Namespace : "openshift-bar" ,
308
+ Name : "azure-cloud-credentials" ,
309
+ },
310
+ },
311
+ },
312
+ want : []* corev1.Secret {
313
+ {
314
+ TypeMeta : metav1.TypeMeta {
315
+ APIVersion : "v1" ,
316
+ Kind : "Secret" ,
317
+ },
318
+ ObjectMeta : metav1.ObjectMeta {
319
+ Namespace : "openshift-foo" ,
320
+ Name : "azure-cloud-credentials" ,
321
+ },
322
+ Type : corev1 .SecretTypeOpaque ,
323
+ StringData : map [string ]string {
324
+ "azure_client_id" : "00f00f00-0f00-0f00-0f00-f00f00f00f00" ,
325
+ "azure_subscription_id" : subscriptionId ,
326
+ "azure_tenant_id" : tenantId ,
327
+ "azure_region" : location ,
328
+ "azure_federated_token_file" : azureFederatedTokenFileLocation ,
329
+ },
330
+ },
331
+ },
332
+ },
284
333
} {
285
334
t .Run (tt .name , func (t * testing.T ) {
286
335
controller := gomock .NewController (t )
0 commit comments