leaderless gossip-based service discovery w/ consul compatibility
5

Configure Feed

Select the types of activity you want to include in your feed.

pass agent config errors up

Jes Olson (Feb 20, 2023, 3:24 PM -0800) abafaa3a ac53842a

+8 -6
+8 -6
command/agent/agent.go
··· 19 19 const gracefulTimeout = 10 * time.Second 20 20 21 21 func Run(args []string) { 22 - // do flags 23 - config := configureAgent() 22 + config, err := configureAgent() 23 + if err != nil { 24 + fmt.Println(err) 25 + os.Exit(1) 26 + } 24 27 agent := agent.New(config) 25 28 if err := agent.Start(); err != nil { 26 29 fmt.Println(err) ··· 104 107 return nil 105 108 } 106 109 107 - func configureAgent() *agent.Config { 110 + func configureAgent() (*agent.Config, error) { 108 111 config := agent.DefaultConfig() 109 112 // CASCADE_BIND=192.168.0.15:12345 110 113 if os.Getenv("CASCADE_BIND") != "" { 111 114 err := parseFlagAddress(os.Getenv("CASCADE_BIND"), config.BindAddr) 112 115 if err != nil { 113 - fmt.Printf("Error parsing CASCADE_BIND: %s\n", err) 114 - os.Exit(1) 116 + return nil, err 115 117 } 116 118 } 117 119 // CASCADE_JOIN=127.0.0.1,127.0.0.5 ··· 122 124 if os.Getenv("CASCADE_NAME") != "" { 123 125 config.NodeName = os.Getenv("CASCADE_NAME") 124 126 } 125 - return config 127 + return config, nil 126 128 } 127 129 128 130 // parseFlagAddress takes a colon-delimited host:port pair as a string, parses