style: align plugin renaming (#10868)

This commit is contained in:
Thomas Casteleyn 2022-04-28 21:40:34 +02:00 committed by GitHub
parent e0212a7d7a
commit 6dc2b99549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 12 deletions

View File

@ -615,10 +615,8 @@ func printFilteredInputs(inputFilters []string, commented bool) {
// Print Inputs // Print Inputs
for _, pname := range pnames { for _, pname := range pnames {
// Skip inputs that are registered twice for backward compatibility // Skip inputs that are registered twice for backward compatibility
if pname == "cisco_telemetry_gnmi" { switch pname {
continue case "cisco_telemetry_gnmi", "io", "KNXListener":
}
if pname == "KNXListener" {
continue continue
} }
creator := inputs.Inputs[pname] creator := inputs.Inputs[pname]
@ -1246,14 +1244,6 @@ func (c *Config) addInput(name string, table *ast.Table) error {
return nil return nil
} }
// Legacy support renaming io input to diskio
if name == "io" {
if err := c.printUserDeprecation("inputs", name, nil); err != nil {
return err
}
name = "diskio"
}
// For inputs with parsers we need to compute the set of // For inputs with parsers we need to compute the set of
// options that is not covered by both, the parser and the input. // options that is not covered by both, the parser and the input.
// We achieve this by keeping a local book of missing entries // We achieve this by keeping a local book of missing entries

View File

@ -184,4 +184,8 @@ func init() {
inputs.Add("diskio", func() telegraf.Input { inputs.Add("diskio", func() telegraf.Input {
return &DiskIO{ps: ps, SkipSerialNumber: true} return &DiskIO{ps: ps, SkipSerialNumber: true}
}) })
// Backwards compatible alias
inputs.Add("io", func() telegraf.Input {
return &DiskIO{ps: ps, SkipSerialNumber: true}
})
} }