mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-12-01 00:15:54 +00:00
The NPD test checks when NPD started to determine if it is needed to check the kubelet start event. The current logic requires parsing the journalctl logs which is quite fragile and is broken now because of systemd changing the expected log format. Newer versions of systemd do not print "end at" or "logs begin at" and instead may print "No entries", which will result in the test panicking. ``` $ journalctl -u foo.service -- No entries -- ``` For units started, it will not print "end at" or "logs begin at": ``` root@ubuntu-jammy:~# journalctl -u foo.service Feb 08 22:02:19 ubuntu-jammy systemd[1]: Started /usr/bin/sleep 1s. Feb 08 22:02:20 ubuntu-jammy systemd[1]: foo.service: Deactivated successfully. ``` To avoid relying on log parsing which is fragile, let's instead directly ask systemd when the NPD service started and parse the resulting timestamp. Signed-off-by: David Porter <david@porter.me>
15 KiB
15 KiB