mirror of
https://github.com/davidallendj/magellan.git
synced 2025-12-20 11:37:01 -07:00
fix(collect): properly set secret when overriding with flags
This commit is contained in:
parent
b50b31ff40
commit
722345cf93
1 changed files with 1 additions and 3 deletions
|
|
@ -87,7 +87,6 @@ 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")
|
||||||
|
|
@ -102,11 +101,10 @@ 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 {
|
||||||
tmpSecrets[k] = string(newCreds)
|
s.StoreSecretByID(k, string(newCreds))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
store.(*secrets.LocalSecretStore).Secrets = tmpSecrets
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue