Merge pull request #1152 from hakman/fix-deprecated-flag
CodeQL / Analyze (go) (push) Failing after 43s
Scorecard supply-chain security / Scorecard analysis (push) Failing after 34s

healthchecker: Fix systemd-service flag deprecation
This commit is contained in:
Kubernetes Prow Robot
2025-10-07 21:30:59 -07:00
committed by GitHub
+2 -2
View File
@@ -52,11 +52,11 @@ func (hco *HealthCheckerOptions) AddFlags(fs *pflag.FlagSet) error {
"The component to check health for. Supports kubelet, docker, kube-proxy, and cri")
// Deprecated: For backward compatibility on linux environment. Going forward "service" will be used instead of systemd-service
if runtime.GOOS == "linux" {
fs.StringVar(&hco.Service, "systemd-service", "",
"The underlying service responsible for the component. Set to the corresponding component for docker and kubelet, containerd for cri.")
if err := fs.MarkDeprecated("systemd-service", "please use --service flag instead"); err != nil {
return fmt.Errorf("failed to mark deprecated flag 'systemd-service': %w", err)
}
fs.StringVar(&hco.Service, "systemd-service", "",
"The underlying service responsible for the component. Set to the corresponding component for docker and kubelet, containerd for cri.")
}
fs.StringVar(&hco.Service, "service", "",
"The underlying service responsible for the component. Set to the corresponding component for docker and kubelet, containerd for cri.")