Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: align plugin renaming #10868

Merged
merged 1 commit into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 2 additions & 12 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,8 @@ func printFilteredInputs(inputFilters []string, commented bool) {
// Print Inputs
for _, pname := range pnames {
// Skip inputs that are registered twice for backward compatibility
if pname == "cisco_telemetry_gnmi" {
continue
}
if pname == "KNXListener" {
switch pname {
case "cisco_telemetry_gnmi", "io", "KNXListener":
continue
}
creator := inputs.Inputs[pname]
Expand Down Expand Up @@ -1243,14 +1241,6 @@ func (c *Config) addInput(name string, table *ast.Table) error {
return nil
}

// Legacy support renaming io input to diskio
if name == "io" {
if err := c.printUserDeprecation("inputs", name, nil); err != nil {
Hipska marked this conversation as resolved.
Show resolved Hide resolved
return err
}
name = "diskio"
}

// For inputs with parsers we need to compute the set of
// options that is not covered by both, the parser and the input.
// We achieve this by keeping a local book of missing entries
Expand Down
4 changes: 4 additions & 0 deletions plugins/inputs/diskio/diskio.go
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,8 @@ func init() {
inputs.Add("diskio", func() telegraf.Input {
return &DiskIO{ps: ps, SkipSerialNumber: true}
})
// Backwards compatible alias
inputs.Add("io", func() telegraf.Input {
return &DiskIO{ps: ps, SkipSerialNumber: true}
})
}