mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
chore: added pre-condition guards for secrets
This commit is contained in:
parent
cdf380bd64
commit
9396de11c2
2 changed files with 8 additions and 1 deletions
|
|
@ -148,7 +148,6 @@ func CrawlBMCForSystems(config CrawlerConfig) ([]InventoryDetail, error) {
|
|||
return walkSystems(rf_systems, nil, config.URI)
|
||||
}
|
||||
|
||||
// CrawlBMCForSystems pulls BMC manager information.
|
||||
// CrawlBMCForManagers connects to a BMC (Baseboard Management Controller) using the provided configuration,
|
||||
// retrieves the ServiceRoot, and then fetches the list of managers from the ServiceRoot.
|
||||
//
|
||||
|
|
@ -374,6 +373,10 @@ func walkManagers(rf_managers []*redfish.Manager, baseURI string) ([]Manager, er
|
|||
}
|
||||
|
||||
func loadBMCCreds(config CrawlerConfig) (BMCUsernamePassword, error) {
|
||||
// NOTE: it is possible for the SecretStore to be nil, so we need a check
|
||||
if config.CredentialStore == nil {
|
||||
return BMCUsernamePassword{}, fmt.Errorf("credential store is invalid")
|
||||
}
|
||||
creds, err := config.CredentialStore.GetSecretByID(config.URI)
|
||||
if err != nil {
|
||||
event := log.Error()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue