Don't allow inputs to overwrite host tag
closes #1054 This affects tags in the following plugins: - cassandra - disque - rethinkdb
This commit is contained in:
@@ -97,8 +97,8 @@ func (s *Server) getServerStatus() error {
|
||||
|
||||
func (s *Server) getDefaultTags() map[string]string {
|
||||
tags := make(map[string]string)
|
||||
tags["host"] = s.Url.Host
|
||||
tags["hostname"] = s.serverStatus.Network.Hostname
|
||||
tags["rethinkdb_host"] = s.Url.Host
|
||||
tags["rethinkdb_hostname"] = s.serverStatus.Network.Hostname
|
||||
return tags
|
||||
}
|
||||
|
||||
|
||||
@@ -20,8 +20,8 @@ func TestGetDefaultTags(t *testing.T) {
|
||||
in string
|
||||
out string
|
||||
}{
|
||||
{"host", server.Url.Host},
|
||||
{"hostname", server.serverStatus.Network.Hostname},
|
||||
{"rethinkdb_host", server.Url.Host},
|
||||
{"rethinkdb_hostname", server.serverStatus.Network.Hostname},
|
||||
}
|
||||
defaultTags := server.getDefaultTags()
|
||||
for _, tt := range tagTests {
|
||||
|
||||
Reference in New Issue
Block a user