Add nil check to operator autopilot endpoint

pull/2897/head
Kyle Havlovitz 8 years ago
parent 196dd81cc5
commit 76d96e2eb0
No known key found for this signature in database
GPG Key ID: 8A5E6B173056AD6C

@ -259,7 +259,7 @@ func (s *Server) getOrCreateAutopilotConfig() (*structs.AutopilotConfig, bool) {
} }
if !ServersMeetMinimumVersion(s.LANMembers(), minAutopilotVersion) { 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 return nil, false
} }

@ -26,6 +26,9 @@ func (op *Operator) AutopilotGetConfiguration(args *structs.DCSpecificRequest, r
if err != nil { if err != nil {
return err return err
} }
if config == nil {
return fmt.Errorf("autopilot config not initialized yet")
}
*reply = *config *reply = *config

Loading…
Cancel
Save