Skip to content

Commit

Permalink
fix: errcheck for parsing CLI flags
Browse files Browse the repository at this point in the history
  • Loading branch information
thevilledev committed Oct 12, 2024
1 parent 62fb8d6 commit a216cf2
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions cmd/vault-plugin-auth-alicloud/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,10 @@ import (
func main() {
apiClientMeta := &api.PluginAPIClientMeta{}
flags := apiClientMeta.FlagSet()
flags.Parse(os.Args[1:])

if err := flags.Parse(os.Args[1:]); err != nil {
fatal(err)
}

tlsConfig := apiClientMeta.GetTLSConfig()
tlsProviderFunc := api.VaultPluginTLSProvider(tlsConfig)
Expand All @@ -27,9 +30,12 @@ func main() {
TLSProviderFunc: tlsProviderFunc,
})
if err != nil {
logger := hclog.New(&hclog.LoggerOptions{})

logger.Error("plugin shutting down", "error", err)
os.Exit(1)
fatal(err)
}
}

func fatal(err error) {
logger := hclog.New(&hclog.LoggerOptions{})
logger.Error("plugin shutting down", "error", err)
os.Exit(1)
}

0 comments on commit a216cf2

Please sign in to comment.