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: Add deprecation notices to plugin options #10616

Merged
merged 15 commits into from
Mar 1, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Add notices to common deprecated settings
  • Loading branch information
Hipska committed Feb 9, 2022
commit 7efaace3cd50886367cbd5ff6c71798c0ae784c0
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,7 @@ type AgentConfig struct {
// TODO(cam): Remove UTC and parameter, they are no longer
// valid for the agent config. Leaving them here for now for backwards-
// compatibility
// Deprecated: 1.0.0 after, has no effect
UTC bool `toml:"utc"`
UTC bool `toml:"utc" deprecated:"1.0.0;ignored"`

// Debug is the option for running in debug mode
Debug bool `toml:"debug"`
Expand Down
7 changes: 1 addition & 6 deletions plugins/common/kafka/config.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package kafka

import (
"log"

"github.com/Shopify/sarama"
"github.com/influxdata/telegraf/plugins/common/tls"
)
Expand Down Expand Up @@ -54,17 +52,14 @@ type Config struct {
CompressionCodec int `toml:"compression_codec"`

// EnableTLS deprecated
EnableTLS *bool `toml:"enable_tls"`
EnableTLS *bool `toml:"enable_tls" deprecated:"1.17.0;ignored"`

// Disable full metadata fetching
MetadataFull *bool `toml:"metadata_full"`
}

// SetConfig on the sarama.Config object from the Config struct.
func (k *Config) SetConfig(config *sarama.Config) error {
if k.EnableTLS != nil {
log.Printf("W! [kafka] enable_tls is deprecated, and the setting does nothing, you can safely remove it from the config")
}
if k.Version != "" {
version, err := sarama.ParseKafkaVersion(k.Version)
if err != nil {
Expand Down