Refine controller template and probe listeners

This commit is contained in:
2026-04-27 00:28:25 +08:00
parent 8fae920fc8
commit d7c2dac944
20 changed files with 780 additions and 217 deletions

View File

@@ -19,8 +19,10 @@ import (
func init() {
klog.InitFlags(nil)
_ = flag.Set("logtostderr", "true")
if os.Getenv("DEBUG") != "" {
_ = flag.Set("v", "4") // debug level
_ = flag.Set("v", "4")
} else {
_ = flag.Set("v", "0")
}
@@ -39,7 +41,11 @@ func NewRootCmd() *cobra.Command {
},
}
// Expose klog stdlib flags through Cobra/pflag.
cmd.PersistentFlags().AddGoFlagSet(flag.CommandLine)
flags.AddFlags(cmd.PersistentFlags())
cmd.AddCommand(
versioncmd.NewCmdVersion(),
initcmd.NewCmdInit(flags),
@@ -49,5 +55,6 @@ func NewRootCmd() *cobra.Command {
controllercmd.NewCmdController(flags),
internalcmd.NewCmdInternal(),
)
return cmd
}