MCPcopy Create free account
hub / github.com/deepflowio/deepflow / setGlobalConfig

Function setGlobalConfig

server/controller/controller/controller.go:232–251  ·  view source on GitHub ↗
(cfg *config.ControllerConfig)

Source from the content-addressed store, hash-verified

230}
231
232func setGlobalConfig(cfg *config.ControllerConfig) {
233 grpcPort, err := strconv.Atoi(cfg.GrpcPort)
234 if err != nil {
235 log.Error("config grpc-port is not a port")
236 time.Sleep(time.Second)
237 os.Exit(0)
238 }
239 grpcNodePort, err := strconv.Atoi(cfg.GrpcNodePort)
240 if err != nil {
241 log.Error("config grpc-node-port is not a port")
242 time.Sleep(time.Second)
243 os.Exit(0)
244 }
245 common.GConfig = &common.GlobalConfig{
246 HTTPPort: cfg.ListenPort,
247 HTTPNodePort: cfg.ListenNodePort,
248 GRPCPort: grpcPort,
249 GRPCNodePort: grpcNodePort,
250 }
251}

Callers 1

StartFunction · 0.85

Calls 1

ErrorMethod · 0.65

Tested by

no test coverage detected