Commit Graph
17 Commits
Author SHA1 Message Date
Andrew Halaney 31d036e27f fix: handle SIGTERM gracefully on unix
We weren't catching SIGTERM and cancelling our context, so the go
runtime would have us exit with a non-zero code when the signal was
received. Let's catch it and try to exit gracefully.

i.e. before:

    (...)
    I0508 11:08:00.426917 1787442 log_monitor.go:237] Initialize condition generated: []
    ^C
    $ echo $?
    130

and now:

    (...)
    I0508 11:07:42.150562 1787146 log_monitor.go:237] Initialize condition generated: []
    ^C
    I0508 11:07:43.372093 1787146 log_monitor.go:123] Stop log monitor /tmp/npd-test.json
    I0508 11:07:43.652876 1787146 log_watcher.go:104] Stop watching filelog
    I0508 11:07:43.652923 1787146 log_monitor.go:144] Log monitor stopped: /tmp/npd-test.json
    $ echo $?
    0
2026-05-08 11:14:38 -05:00
Pierluigi LenociandCiprian Hacman 0c927ad8ec fix: honor stderrthreshold on Windows entrypoint
The Unix entrypoint already sets legacy_stderr_threshold_behavior=false
and stderrthreshold=INFO, but the Windows entrypoint was missed.

klog v2 defaults -logtostderr to true. When active, -stderrthreshold is
silently ignored — all log levels are unconditionally sent to stderr.
Setting legacy_stderr_threshold_behavior=false enables the fix so that
-stderrthreshold is honored even when -logtostderr=true.

Ref: kubernetes/klog#212, kubernetes/klog#432

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
Signed-off-by: Pierluigi Lenoci <pierluigilenoci@gmail.com>
2026-04-23 11:53:08 +03:00
Pierluigi Lenoci c4d4af5bc6 Honor stderrthreshold when logtostderr is enabled
Opt into the fixed klog behavior by setting legacy_stderr_threshold_behavior=false
after klog.InitFlags(). Ref: kubernetes/klog#212, kubernetes/klog#432

Signed-off-by: Pierluigi Lenoci <pierluigi.lenoci@gmail.com>
2026-03-27 00:15:23 +01:00
Ciprian Hacman 2e69489cc6 Update golangci-lint to v2.6.2 2025-11-29 10:42:18 +02:00
Sergey Kanzhelev 0ce333bbc5 enabled and fixed the errcheck linter rule 2025-09-10 21:45:46 +00:00
Sergey Kanzhelev 75bf501888 format imports 2025-08-13 16:56:32 +00:00
Ciprian Hacman 5210373640 Init useful flags for klog/v2 2023-09-17 11:00:42 +03:00
Manuel RügerandCiprian Hacman e43459d86d Move glog/klog logging to klog/v2 2023-09-17 08:57:33 +03:00
Fan Shang Xiang 471ab88240 add context to long running operations 2023-07-13 10:01:18 +08:00
Kubernetes Prow RobotandGitHub e6fbdd434a Merge pull request #760 from MartinForReal/master
bump k8s.io dependencies to 1.17.2
2023-06-25 21:41:16 -07:00
guoguangwu 6dc23ca804 chore: remove refs to deprecated io/ioutil 2023-06-21 12:12:27 +08:00
Fan Shang Xiang b5e4ef628b bump k8s.io to 1.17.2 2023-06-12 22:27:39 +08:00
michelletandya c4e5400ed6 separate linux/windows health checker files. 2021-04-26 21:45:05 +00:00
Jeremy Edwards a7f78c5668 Enable NPD to run as a Windows Service. 2021-04-02 23:03:14 -07:00
Xuewei Zhang 0f0e5eff0f Adding stackdriver exporter 2019-09-12 18:30:00 -07:00
Xuewei Zhang 225de07427 Correctly identify failures in problem daemon starting. 2019-06-26 17:55:11 -07:00
Xuewei Zhang be2647a686 Allow compilation time disabling for each type of Problem Daemon. 2019-06-17 16:02:45 -07:00