Watch
0
0
Fork
You've already forked hyperhive
0

vm-tests: a running collector keeps its cursor when it switches to the static user

This commit is contained in:
atlas 2026-11-21 15:04:35 +01:00 • committed by maia
commit 0461d8add8
2 changed files with 148 additions and 1 deletions

View file

@ -53,10 +53,17 @@ creates it. The user reads nothing else the file mode doesn't already let
every user read. With the node off, the unit and the collector's configuration
are the ones it has without the module.
A collector that already runs as a dynamic user when you turn the node on keeps
its state, such as the journald cursor. systemd moves the state directory out
of `/var/lib/private` for the static user, and the unit sees the files as its
own, so the receiver resumes from its cursor and ships nothing twice.
## Validation
`module-eval-k8s` checks the configuration with the option on and off, the
rendered endpoints, and the ACL's path. The VM test `k8s-node` runs a pod that
rendered endpoints, and the ACL's path. The VM test `k8s-collector-switch`
switches a running collector from a dynamic to the static user and checks that
its cursor survives. The VM test `k8s-node` runs a pod that
writes a `WARN` and an `INFO` line, and checks that the collector's user reads
the pod's log file, that the lines arrive with those severities under the
container's name, and that a metric a pod pushes arrives.

View file

@ -122,3 +122,6 @@ and delete a pod while recording its exit and how long the delete took.
test on its own, by name: the all-tests run can pass the one-hour job limit.
`k8s-node` boots a host with `services.hyperhive.deploy.k8s.enable` instead,
so the node is the module's own and not the harness's.
`k8s-collector-switch` boots a host whose collector runs as a dynamic user,
switches it to the node's configuration with `switch-to-configuration`, and
checks that the collector keeps its state as the static user.