Skip to content

Commit

Permalink
Fixing yaml parsing bug with vault client setup (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
dkyanakiev authored Jan 24, 2024
1 parent 09789e2 commit 982dbf0
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.1.1] - 2024-01-24

## Added

- Additional error message when failing to create vault client

## Fixed

- Fixed loading for client key when using VAULT_CLIENT_KEY

## [0.1.0] - 2024-01-23

## Added
Expand Down
5 changes: 5 additions & 0 deletions cmd/vaul7y/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ func main() {
vaultClient, err := vault.New(func(v *vault.Vault) error {
return vault.Default(v, logger, cfg)
})
if err != nil {
fmt.Printf("Failed to start Vault client: %v\n", err)
os.Exit(1)
}

refreshIntervalDefault := time.Duration(cfg.VaultyRefreshRate) * time.Second
state := initializeState(vaultClient, cfg.VaultNamespace)
toggles := component.NewTogglesInfo()
Expand Down
4 changes: 2 additions & 2 deletions internal/config/configs.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ type Config struct {
VaultToken string `yaml:"vault_token"`
VaultCaCert string `yaml:"vault_cacert"`
VaultClientCert string `yaml:"vault_client_cert"`
VaultClientKey string `yaml:"vault_client_Key"`
VaultClientKey string `yaml:"vault_client_key"`
VaultyLogFile string `yaml:"vaulty_log_file"`
VaultyLogLevel string `yaml:"vaulty_log_level"`
VaultyRefreshRate int `yaml:"vaulty_refresh_rate"`
Expand Down Expand Up @@ -79,7 +79,7 @@ func LoadConfig() Config {
config.VaultClientCert = vaultClientCert
}
if vaultClientKey := os.Getenv("VAULT_CLIENT_KEY"); vaultClientKey != "" {
config.VaultClientCert = vaultClientKey
config.VaultClientKey = vaultClientKey
}
if vaultyLogFile := os.Getenv("VAULTY_LOG_FILE"); vaultyLogFile != "" {
config.VaultyLogFile = vaultyLogFile
Expand Down

0 comments on commit 982dbf0

Please sign in to comment.