From b8f4ff25af96a94ff7245865d7eb8c6de1a35cac Mon Sep 17 00:00:00 2001 From: 9547 Date: Wed, 24 Feb 2021 10:20:49 +0800 Subject: [PATCH] fix(playground): use the advertised host instead of 0.0.0.0 (#1152) --- components/playground/playground.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/playground/playground.go b/components/playground/playground.go index 63fc274cad..fdde0f20ff 100644 --- a/components/playground/playground.go +++ b/components/playground/playground.go @@ -380,7 +380,7 @@ func (p *Playground) sanitizeConfig(boot instance.Config, cfg *instance.Config) cfg.ConfigPath = boot.ConfigPath } if cfg.Host == "" { - cfg.Host = boot.ConfigPath + cfg.Host = boot.Host } path, err := getAbsolutePath(cfg.ConfigPath) @@ -610,6 +610,9 @@ func (p *Playground) addInstance(componentID string, cfg instance.Config) (ins i host = cfg.Host } + // use the advertised host instead of 0.0.0.0 + host = instance.AdvertiseHost(host) + switch componentID { case "pd": inst := instance.NewPDInstance(cfg.BinPath, dir, host, cfg.ConfigPath, id)