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

Remove --expose-kernel-addresses and --pprof-addr flags #3042

Merged
merged 1 commit into from
Oct 24, 2024
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
4 changes: 0 additions & 4 deletions docs/data/tetragon_flags.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion examples/configuration/tetragon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ log-level: info
metrics-server:
metrics-label-filter:
netns-dir: /var/run/docker/netns/
pprof-addr:
pprof-address:
process-cache-size: 65536
procfs: /proc/
rb-size: 0
Expand Down
29 changes: 6 additions & 23 deletions pkg/option/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ const (
KeyTracingPolicy = "tracing-policy"
KeyTracingPolicyDir = "tracing-policy-dir"

KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-address"
KeyDeprecatedPprofAddr = "pprof-addr"
KeyCpuProfile = "cpuprofile"
KeyMemProfile = "memprofile"
KeyPprofAddr = "pprof-address"

KeyExportFilename = "export-filename"
KeyExportFileMaxSizeMB = "export-file-max-size-mb"
Expand Down Expand Up @@ -92,8 +91,7 @@ const (
KeyEnablePodInfo = "enable-pod-info"
KeyEnableTracingPolicyCRD = "enable-tracing-policy-crd"

KeyExposeStackAddresses = "expose-stack-addresses"
KeyExposeKernelAddresses = "expose-kernel-addresses"
KeyExposeStackAddresses = "expose-stack-addresses"

KeyGenerateDocs = "generate-docs"

Expand Down Expand Up @@ -192,10 +190,7 @@ func ReadAndSetFlags() error {

Config.CpuProfile = viper.GetString(KeyCpuProfile)
Config.MemProfile = viper.GetString(KeyMemProfile)
Config.PprofAddr = viper.GetString(KeyDeprecatedPprofAddr)
if viper.IsSet(KeyPprofAddr) {
Config.PprofAddr = viper.GetString(KeyPprofAddr)
}
Config.PprofAddr = viper.GetString(KeyPprofAddr)

Config.EventQueueSize = viper.GetUint(KeyEventQueueSize)

Expand All @@ -222,15 +217,7 @@ func ReadAndSetFlags() error {
return fmt.Errorf("unknown option for %s: %q", KeyUsernameMetadata, o)
}

// manually handle the deprecation of --expose-kernel-addresses
if viper.IsSet(KeyExposeKernelAddresses) {
log.Warnf("Flag --%s has been deprecated, please use --%s instead", KeyExposeKernelAddresses, KeyExposeStackAddresses)
Config.ExposeStackAddresses = viper.GetBool(KeyExposeKernelAddresses)
}
// if both --expose-kernel-addresses and --expose-stack-addresses are set, the latter takes priority
if viper.IsSet(KeyExposeStackAddresses) {
Config.ExposeStackAddresses = viper.GetBool(KeyExposeStackAddresses)
}
Config.ExposeStackAddresses = viper.GetBool(KeyExposeStackAddresses)

Config.CgroupRate = ParseCgroupRate(viper.GetString(KeyCgroupRate))
Config.HealthServerAddress = viper.GetString(KeyHealthServerAddress)
Expand Down Expand Up @@ -345,8 +332,6 @@ func AddFlags(flags *pflag.FlagSet) {
flags.MarkHidden(KeyMemProfile)

flags.String(KeyPprofAddr, "", "Serves runtime profile data via HTTP (e.g. 'localhost:6060'). Disabled by default")
flags.String(KeyDeprecatedPprofAddr, "", "")
flags.MarkDeprecated(KeyDeprecatedPprofAddr, "please use --pprof-address")

// JSON export aggregation options.
flags.Bool(KeyEnableExportAggregation, false, "Enable JSON export aggregation")
Expand Down Expand Up @@ -393,9 +378,7 @@ func AddFlags(flags *pflag.FlagSet) {
flags.Bool(KeyEnablePodInfo, false, "Enable PodInfo custom resource")
flags.Bool(KeyEnableTracingPolicyCRD, true, "Enable TracingPolicy and TracingPolicyNamespaced custom resources")

flags.Bool(KeyExposeKernelAddresses, false, "Expose real kernel addresses in events stack traces")
flags.Bool(KeyExposeStackAddresses, false, "Expose real linear addresses in events stack traces")
flags.MarkHidden(KeyExposeKernelAddresses)

flags.Bool(KeyGenerateDocs, false, "Generate documentation in YAML format to stdout")

Expand Down
Loading