mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 03:27:03 -07:00
fix(collect): make sure secret store is set
This commit is contained in:
parent
541fb6ebb0
commit
0ed861e3a7
1 changed files with 3 additions and 1 deletions
|
|
@ -91,6 +91,7 @@ var CollectCmd = &cobra.Command{
|
||||||
s.Password = password
|
s.Password = password
|
||||||
}
|
}
|
||||||
case *secrets.LocalSecretStore:
|
case *secrets.LocalSecretStore:
|
||||||
|
tmpSecrets := make(map[string]string)
|
||||||
for k, _ := range s.Secrets {
|
for k, _ := range s.Secrets {
|
||||||
if creds, err := bmc.GetBMCCredentials(store, k); err != nil {
|
if creds, err := bmc.GetBMCCredentials(store, k); err != nil {
|
||||||
log.Error().Str("id", k).Err(err).Msg("failed to get BMC credentials from secret store")
|
log.Error().Str("id", k).Err(err).Msg("failed to get BMC credentials from secret store")
|
||||||
|
|
@ -105,10 +106,11 @@ var CollectCmd = &cobra.Command{
|
||||||
if newCreds, err := json.Marshal(creds); err != nil {
|
if newCreds, err := json.Marshal(creds); err != nil {
|
||||||
log.Error().Str("id", k).Err(err).Msg("failed to marshal updated BMC credentials")
|
log.Error().Str("id", k).Err(err).Msg("failed to marshal updated BMC credentials")
|
||||||
} else {
|
} else {
|
||||||
s.Secrets[k] = string(newCreds)
|
tmpSecrets[k] = string(newCreds)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
store.(*secrets.LocalSecretStore).Secrets = tmpSecrets
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue