mirror of https://github.com/status-im/consul.git
Add nil check to operator autopilot endpoint
This commit is contained in:
parent
196dd81cc5
commit
76d96e2eb0
|
@ -259,7 +259,7 @@ func (s *Server) getOrCreateAutopilotConfig() (*structs.AutopilotConfig, bool) {
|
|||
}
|
||||
|
||||
if !ServersMeetMinimumVersion(s.LANMembers(), minAutopilotVersion) {
|
||||
s.logger.Printf("[ERR] autopilot: can't initialize until all servers are >= %s", minAutopilotVersion.String())
|
||||
s.logger.Printf("[WARN] autopilot: can't initialize until all servers are >= %s", minAutopilotVersion.String())
|
||||
return nil, false
|
||||
}
|
||||
|
||||
|
|
|
@ -26,6 +26,9 @@ func (op *Operator) AutopilotGetConfiguration(args *structs.DCSpecificRequest, r
|
|||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if config == nil {
|
||||
return fmt.Errorf("autopilot config not initialized yet")
|
||||
}
|
||||
|
||||
*reply = *config
|
||||
|
||||
|
|
Loading…
Reference in New Issue