Merge branch 'main' into update-firmware

This commit is contained in:
David Allen 2023-10-10 11:14:31 -06:00 committed by GitHub
commit 2c4cd02a5a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 46 additions and 22 deletions

View file

@ -33,12 +33,6 @@ const (
HTTPS_PORT = 443
)
type BMCProbeResult struct {
Host string `json:"host"`
Port int `json:"port"`
Protocol string `json:"protocol"`
State bool `json:"state"`
}
// NOTE: ...params were getting too long...
type QueryParams struct {
@ -108,7 +102,7 @@ func NewClient(l *log.Logger, q *QueryParams) (*bmclib.Client, error) {
return client, nil
}
func CollectInfo(probeStates *[]BMCProbeResult, l *log.Logger, q *QueryParams) error {
func CollectInfo(probeStates *[]ScannedResult, l *log.Logger, q *QueryParams) error {
// check for available probe states
if probeStates == nil {
return fmt.Errorf("no probe states found")
@ -126,7 +120,7 @@ func CollectInfo(probeStates *[]BMCProbeResult, l *log.Logger, q *QueryParams) e
found := make([]string, 0, len(*probeStates))
done := make(chan struct{}, q.Threads+1)
chanProbeState := make(chan BMCProbeResult, q.Threads+1)
chanProbeState := make(chan ScannedResult, q.Threads+1)
// generate custom xnames for bmcs
node := xnames.Node{
@ -630,9 +624,10 @@ func connectGofish(q *QueryParams) (*gofish.APIClient, error) {
config := makeGofishConfig(q)
c, err := gofish.Connect(config)
if err != nil {
return nil, err
return nil, fmt.Errorf("could not connect to redfish endpoint: %v", err)
}
if c.Service != nil {
if c != nil {
c.Service.ProtocolFeaturesSupported = gofish.ProtocolFeaturesSupported{
ExpandQuery: gofish.Expand{
ExpandAll: true,