Skip to content

Commit

Permalink
Append a short random ID to Spinwick Installation IDs to force unique…
Browse files Browse the repository at this point in the history
… DNS
  • Loading branch information
nickmisasi committed Dec 4, 2024
1 parent 09e70d7 commit f1956c1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/spinwick.go
Original file line number Diff line number Diff line change
Expand Up @@ -1123,7 +1123,7 @@ func checkMMPing(ctx context.Context, client *mattermostModel.Client4) error {

func (s *Server) makeSpinWickID(repoName string, prNumber int) string {
domainName := s.Config.DNSNameTestServer
spinWickID := strings.ToLower(fmt.Sprintf("%s-pr-%d", repoName, prNumber))
spinWickID := strings.ToLower(fmt.Sprintf("%s-pr-%d-%s", repoName, prNumber, cloudModel.NewID()[0:5]))
// DNS names in MM cloud have a character limit. The number of characters in the domain - 64 will be how many we need to trim
numCharactersToTrim := len(spinWickID+domainName) - 64
if numCharactersToTrim > 0 {
Expand Down

0 comments on commit f1956c1

Please sign in to comment.