-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Randomly generate service/plan IDs on startup
This change allows users of service-catalog to register more than one instance of the overview broker in the same k8s deployment. Co-authored-by: Ed King <eking@pivotal.io> Co-authored-by: Gabriele Cipriano <gcipriano@pivotal.io>
- Loading branch information
1 parent
d833704
commit e11bba2
Showing
2 changed files
with
20 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
function GenerateUUID() { | ||
var dt = new Date().getTime(); | ||
|
||
var uuid = 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) { | ||
var r = (dt + Math.random()*16)%16 | 0; | ||
dt = Math.floor(dt/16); | ||
return (c=='x' ? r :(r&0x3|0x8)).toString(16); | ||
}); | ||
|
||
return uuid; | ||
} | ||
|
||
module.exports = GenerateUUID; |