@@ -234,6 +234,7 @@ func getMdbEvents(ctx context.Context, operatorClusterClient kubeclient.Client,
234
234
Type : string (item .Spec .GetResourceType ()),
235
235
IsRunningEnterpriseImage : images .IsEnterpriseImage (imageURL ),
236
236
ExternalDomains : getExternalDomainProperty (item ),
237
+ CustomRoles : getCustomRoles (item .Spec .Security ),
237
238
}
238
239
239
240
if numberOfClustersUsed > 0 {
@@ -272,6 +273,7 @@ func addMultiEvents(ctx context.Context, operatorClusterClient kubeclient.Client
272
273
Type : string (item .Spec .GetResourceType ()),
273
274
IsRunningEnterpriseImage : images .IsEnterpriseImage (imageURL ),
274
275
ExternalDomains : getExternalDomainPropertyForMongoDBMulti (item ),
276
+ CustomRoles : getCustomRoles (item .Spec .Security ),
275
277
}
276
278
277
279
if event := createEvent (properties , now , Deployments ); event != nil {
@@ -534,3 +536,25 @@ func isExternalDomainSpecifiedInClusterSpecList(clusterSpecList mdbv1.ClusterSpe
534
536
535
537
return clusterSpecList .IsExternalDomainSpecifiedInClusterSpecList ()
536
538
}
539
+
540
+ const (
541
+ CustomRoleNone = "None"
542
+ CustomRoleEmbedded = "Embedded"
543
+ CustomRoleReferenced = "Referenced"
544
+ )
545
+
546
+ func getCustomRoles (security * mdbv1.Security ) string {
547
+ if security == nil {
548
+ return CustomRoleNone
549
+ }
550
+
551
+ if len (security .Roles ) > 0 {
552
+ return CustomRoleEmbedded
553
+ }
554
+
555
+ if len (security .RoleRefs ) > 0 {
556
+ return CustomRoleReferenced
557
+ }
558
+
559
+ return CustomRoleNone
560
+ }
0 commit comments