Skip to content

Commit

Permalink
Add system name checking to the Managers helper method:
Browse files Browse the repository at this point in the history
This allows the systemName struct field to filter
the managers. Needed for things like inserting and
ejecting virtual media.

Signed-off-by: Jacob Weinstock <[email protected]>
  • Loading branch information
jacobweinstock committed Oct 25, 2024
1 parent 8a5f5a1 commit 26229cf
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion internal/redfishwrapper/system.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,24 @@ func (c *Client) Managers(ctx context.Context) ([]*redfish.Manager, error) {
return nil, errors.Wrap(bmclibErrs.ErrNotAuthenticated, err.Error())
}

return c.client.Service.Managers()
ms, err := c.client.Service.Managers()
if err != nil {
return nil, err
}

for _, m := range ms {
sys, err := m.ManagerForServers()
if err != nil {
continue
}
for _, s := range sys {
if s.Name == c.systemName {
return []*redfish.Manager{m}, nil
}
}
}

return ms, nil
}

// Chassis gets the chassis instances managed by this service.
Expand Down

0 comments on commit 26229cf

Please sign in to comment.