Skip to content

Commit

Permalink
bugfix configuration lookup
Browse files Browse the repository at this point in the history
  • Loading branch information
Argelbargel committed Sep 18, 2023
1 parent 00060cb commit 2447ba1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion internal/app/vault_raft_snapshot_agent/config/rattlesnake.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ package config
import (
"errors"
"fmt"
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/app/vault_raft_snapshot_agent/secret"
"path/filepath"
"reflect"
"strings"

"github.com/Argelbargel/vault-raft-snapshot-agent/internal/app/vault_raft_snapshot_agent/secret"

"github.com/creasty/defaults"
"github.com/fsnotify/fsnotify"
"github.com/go-playground/validator/v10"
Expand Down
2 changes: 1 addition & 1 deletion internal/app/vault_raft_snapshot_agent/snapshotter.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ type snapshotterVaultAPI interface {

func CreateSnapshotter(options SnapshotterOptions) (*Snapshotter, error) {
data := SnapshotterConfig{}
parser := config.NewParser[*SnapshotterConfig](options.ConfigFileName, options.EnvPrefix, options.ConfigFileSearchPaths...)
parser := config.NewParser[*SnapshotterConfig](options.EnvPrefix, options.ConfigFileName, options.ConfigFileSearchPaths...)

if err := parser.ReadConfig(&data, options.ConfigFilePath); err != nil {
return nil, err
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func TestReadCompleteConfig(t *testing.T) {
}

func TestReadConfigSetsDefaultValues(t *testing.T) {
configFile := "../../../testdata/defaults.yaml"
configFile := "../../../testdata/snapshots.yaml"

expectedConfig := SnapshotterConfig{
Vault: vault.ClientConfig{
Expand Down
File renamed without changes.

0 comments on commit 2447ba1

Please sign in to comment.