Merge pull request #7843 from hashicorp/oss-sync/auditing-config

agent/config: Fix tests & include Audit struct as a pointer on Config
This commit is contained in:
Kit Patella 2020-05-11 14:23:44 -07:00 committed by GitHub
commit 58ee349a83
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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