remote: fix two dropped errors

This commit is contained in:
Lars Lehtonen 2019-09-18 08:47:54 -07:00 committed by Márk Sági-Kazár
parent 99520c81d8
commit 583f79b3ea
1 changed files with 3 additions and 2 deletions

View File

@ -77,11 +77,12 @@ func getConfigManager(rp viper.RemoteProvider) (crypt.ConfigManager, error) {
var err error
if rp.SecretKeyring() != "" {
kr, err := os.Open(rp.SecretKeyring())
defer kr.Close()
var kr *os.File
kr, err = os.Open(rp.SecretKeyring())
if err != nil {
return nil, err
}
defer kr.Close()
if rp.Provider() == "etcd" {
cm, err = crypt.NewEtcdConfigManager([]string{rp.Endpoint()}, kr)
} else {