From 10b3478a4dea6d2445ae67a6ae70d62998dac3ae Mon Sep 17 00:00:00 2001 From: Kit Patella Date: Mon, 11 May 2020 14:13:05 -0700 Subject: [PATCH] agent/config: include Audit struct as a pointer on Config, fix tests --- agent/config/builder_oss.go | 2 +- agent/config/config.go | 2 +- agent/config/runtime_test.go | 6 ++++++ 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/agent/config/builder_oss.go b/agent/config/builder_oss.go index 48f943ed55..b585cab504 100644 --- a/agent/config/builder_oss.go +++ b/agent/config/builder_oss.go @@ -38,7 +38,7 @@ var ( c.ACL.Tokens.ManagedServiceProvider = nil }, "audit": func(c *Config) { - c.Audit = Audit{} + c.Audit = nil }, } ) diff --git a/agent/config/config.go b/agent/config/config.go index 3a3ee0c3f5..b0b0219654 100644 --- a/agent/config/config.go +++ b/agent/config/config.go @@ -320,7 +320,7 @@ type Config struct { VersionPrerelease *string `json:"version_prerelease,omitempty" hcl:"version_prerelease" mapstructure:"version_prerelease"` // Enterprise Only - Audit Audit `json:"audit,omitempty" hcl:"audit" mapstructure:"audit"` + Audit *Audit `json:"audit,omitempty" hcl:"audit" mapstructure:"audit"` // Enterprise Only NonVotingServer *bool `json:"non_voting_server,omitempty" hcl:"non_voting_server" mapstructure:"non_voting_server"` // Enterprise Only diff --git a/agent/config/runtime_test.go b/agent/config/runtime_test.go index 767d94f36d..09be53060e 100644 --- a/agent/config/runtime_test.go +++ b/agent/config/runtime_test.go @@ -3943,6 +3943,9 @@ func TestFullConfig(t *testing.T) { }, "advertise_addr": "17.99.29.16", "advertise_addr_wan": "78.63.37.19", + "audit": { + "enabled": false + }, "autopilot": { "cleanup_dead_servers": true, "disable_upgrade_migration": true, @@ -4576,6 +4579,9 @@ func TestFullConfig(t *testing.T) { } advertise_addr = "17.99.29.16" advertise_addr_wan = "78.63.37.19" + audit = { + enabled = false + } autopilot = { cleanup_dead_servers = true disable_upgrade_migration = true