Skip to content

Commit

Permalink
add debug log to print keyring error
Browse files Browse the repository at this point in the history
  • Loading branch information
maidul98 committed Aug 7, 2024
1 parent 4f998e3 commit 68e05b7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/packages/util/keyringwrapper.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package util

import (
"encoding/base64"
"fmt"

"github.com/manifoldco/promptui"
"github.com/rs/zerolog/log"
"github.com/zalando/go-keyring"
)

Expand All @@ -26,6 +28,7 @@ func SetValueInKeyring(key, value string) error {
err = keyring.Set(currentVaultBackend, MAIN_KEYRING_SERVICE, key, value)

if err != nil {
log.Debug().Msg(fmt.Sprintf("Error while setting default keyring: %v", err))
configFile, _ := GetConfigFile()

if configFile.VaultBackendPassphrase == "" {
Expand All @@ -50,6 +53,7 @@ func SetValueInKeyring(key, value string) error {
}

err = keyring.Set(VAULT_BACKEND_FILE_MODE, MAIN_KEYRING_SERVICE, key, value)
log.Debug().Msg(fmt.Sprintf("Error while setting file keyring: %v", err))
}

return err
Expand Down

0 comments on commit 68e05b7

Please sign in to comment.