Skip to content

Commit bfd1129

Browse files
committed
refactor: update GetDeterministicContactGroupDisplayName to use UID instead of display name, visibility, and namespace
1 parent 26e58a3 commit bfd1129

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

internal/emailprovider/utils.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
package emailprovider
22

33
import (
4-
"fmt"
5-
64
notificationmiloapiscomv1alpha1 "go.miloapis.com/milo/pkg/apis/notification/v1alpha1"
75
)
86

97
// getDeterministicContactGroupName returns a deterministic contact group displayname for the contact group.
108
// As the email provider does not support namespaces or custom identifiers, we need to use a deterministic name for the contact group
119
// stored in the email provider.
1210
func GetDeterministicContactGroupDisplayName(contactGroup *notificationmiloapiscomv1alpha1.ContactGroup) string {
13-
return fmt.Sprintf("%s-%s-%s", contactGroup.Spec.DisplayName, contactGroup.Spec.Visibility, contactGroup.Namespace)
11+
return string(contactGroup.UID)
1412
}

0 commit comments

Comments
 (0)