Skip to content

Commit

Permalink
don't fail on incorrect cluster id
Browse files Browse the repository at this point in the history
  • Loading branch information
feedmeapples committed Feb 3, 2023
1 parent 4b05678 commit de07eb0
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions temporal/fx.go
Original file line number Diff line number Diff line change
Expand Up @@ -667,12 +667,14 @@ func ApplyClusterMetadataConfigProvider(
continue
}

clusterId := uuid.New()
if clusterInfo.ClusterID != "" {
if uuid.Parse(clusterInfo.ClusterID) == nil {
return config.ClusterMetadata, config.Persistence, fmt.Errorf("invalid cluster id: %v", clusterInfo.ClusterID)
var clusterId string
if uuid.Parse(clusterInfo.ClusterID) == nil {
if clusterInfo.ClusterID != "" {
logger.Warn("Cluster ID in Cluster Metadata config is not a valid uuid. Generated new Cluster ID. ")
}

clusterId = uuid.New()
} else {
clusterId = clusterInfo.ClusterID
}

Expand Down

0 comments on commit de07eb0

Please sign in to comment.