mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
Added checks for connectGofish to prevent panics
This commit is contained in:
parent
f59d68797d
commit
4d6ffd213b
1 changed files with 10 additions and 5 deletions
|
|
@ -632,11 +632,16 @@ func QueryProcessors(q *QueryParams) ([]byte, error) {
|
|||
func connectGofish(q *QueryParams) (*gofish.APIClient, error) {
|
||||
config := makeGofishConfig(q)
|
||||
c, err := gofish.Connect(config)
|
||||
c.Service.ProtocolFeaturesSupported = gofish.ProtocolFeaturesSupported{
|
||||
ExpandQuery: gofish.Expand{
|
||||
ExpandAll: true,
|
||||
Links: true,
|
||||
},
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("could not connect to redfish endpoint: %v", err)
|
||||
}
|
||||
if c != nil {
|
||||
c.Service.ProtocolFeaturesSupported = gofish.ProtocolFeaturesSupported{
|
||||
ExpandQuery: gofish.Expand{
|
||||
ExpandAll: true,
|
||||
Links: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
return c, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue