Fix: pprof addr checked before parsed (#5495)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
Somefive
2023-02-14 11:33:17 +08:00
committed by GitHub
parent 30278993d9
commit c222862b32

View File

@@ -86,9 +86,6 @@ the core control loops shipped with KubeVela`,
for _, set := range namedFlagSets.FlagSets {
fs.AddFlagSet(set)
}
if s.PprofAddr != "" {
go pkgutil.EnablePprof(s.PprofAddr, nil)
}
meta.Name = types.VelaCoreName
klog.InfoS("KubeVela information", "version", version.VelaVersion, "revision", version.GitRevision)
@@ -114,6 +111,10 @@ func run(ctx context.Context, s *options.CoreOptions) error {
"Burst", restConfig.Burst,
)
if s.PprofAddr != "" {
go pkgutil.EnablePprof(s.PprofAddr, nil)
}
// wrapper the round tripper by multi cluster rewriter
if s.EnableClusterGateway {
client, err := multicluster.Initialize(restConfig, true)