Skip to content

Commit

Permalink
add options to complete configuratin example
Browse files Browse the repository at this point in the history
  • Loading branch information
Argelbargel committed Sep 30, 2024
1 parent 7b94ea6 commit b1c82b3
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
24 changes: 13 additions & 11 deletions internal/agent/snapshot-agent-config_test.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package agent

import (
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/config/secret"
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/test"
"path/filepath"
"strings"
"testing"
"time"

"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/config/secret"
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/test"

"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/config"
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/storage"
"github.com/Argelbargel/vault-raft-snapshot-agent/internal/agent/vault"
Expand Down Expand Up @@ -35,7 +36,8 @@ func TestReadCompleteConfig(t *testing.T) {
expectedConfig := SnapshotAgentConfig{
Vault: vault.VaultClientConfig{
Nodes: vault.VaultNodesConfig{
Urls: []string{"https://example.com:8200"},
Urls: []string{"https://node1.example.com:8200", "https://node2.example.com:8200"},
AutoDetectLeader: true,
},
Insecure: true,
Timeout: 5 * time.Minute,
Expand Down Expand Up @@ -138,13 +140,13 @@ func TestReadCompleteConfig(t *testing.T) {
StorageControllerConfig: storage.StorageControllerConfig{
Retain: test.PtrTo(4),
},
Endpoint: "test-s3-endpoint",
Bucket: "test-s3-bucket",
AccessKeyId: "test-s3-key",
AccessKey: "test-s3-secret",
SessionToken: "test-s3-token",
Region: "test-s3-region",
Insecure: true,
Endpoint: "test-s3-endpoint",
Bucket: "test-s3-bucket",
AccessKeyId: "test-s3-key",
AccessKey: "test-s3-secret",
SessionToken: "test-s3-token",
Region: "test-s3-region",
Insecure: true,
SkipSSLVerify: true,
},
},
Expand All @@ -165,7 +167,7 @@ func TestReadConfigSetsDefaultValues(t *testing.T) {
expectedConfig := SnapshotAgentConfig{
Vault: vault.VaultClientConfig{
Nodes: vault.VaultNodesConfig{
Urls: []string {"http://127.0.0.1:8200"},
Urls: []string{"http://127.0.0.1:8200"},
},
Insecure: false,
Timeout: time.Minute,
Expand Down
4 changes: 3 additions & 1 deletion testdata/complete.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
vault:
nodes:
urls:
- "https://example.com:8200"
- "https://node1.example.com:8200"
- "https://node2.example.com:8200"
autoDetectLeader: true
insecure: true
timeout: 5m
auth:
Expand Down

0 comments on commit b1c82b3

Please sign in to comment.