Skip to content

Commit

Permalink
Fix crypto error handling
Browse files Browse the repository at this point in the history
The error check was being executed prematurely, which breaks some console shared repos (where the filesystem is read-only and a crypto provider fails to materialize, but you can still use the age provider)
  • Loading branch information
michaeljguarino committed Aug 11, 2022
1 parent fca4415 commit a81c413
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions pkg/crypto/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,10 @@ func ReadConfig() (conf *Config, err error) {
}

func Build() (Provider, error) {
fallback, err := fallbackProvider()
if err != nil {
return nil, err
}
if utils.Exists(configPath()) {
conf, err := ReadConfig()

if err != nil {
return fallback, err
return fallbackProvider()
}

switch conf.Type {
Expand All @@ -52,7 +47,7 @@ func Build() (Provider, error) {
}
}

return fallback, err
return fallbackProvider()
}

func fallbackProvider() (*KeyProvider, error) {
Expand Down

0 comments on commit a81c413

Please sign in to comment.