agent/config: include Audit struct as a pointer on Config, fix tests

This commit is contained in:
Kit Patella 2020-05-11 14:13:05 -07:00
parent f82a97f8c8
commit a4ee78440b
3 changed files with 8 additions and 2 deletions

View File

@ -38,7 +38,7 @@ var (
c.ACL.Tokens.ManagedServiceProvider = nil
},
"audit": func(c *Config) {
c.Audit = Audit{}
c.Audit = nil
},
}
)

View File

@ -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

View File

@ -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