Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/nix/script-tests
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas be7eaa8181 refresh-consumer: compare mtimes locale-independently so an unchanged secret doesn't restart its unit
`refresh_unit` read the credential file's mtime with
`stat -c %.6Y | tr -d .`. coreutils prints that fraction with the
locale's decimal separator, so on a host whose locale uses a comma
(muede-lpt2: `1791232888,193159`) `tr` stripped nothing, the `-le`
against the unit's start errored, the "unchanged" early return was
skipped, and every run try-restarted the consumer. Every unit on a
store-refresh timer was restarted every ~10 minutes; for
`swarm-bao-ci-runner` that is `gitea-runner-swarm`, which killed every
CI job running at the time.

The mtime is now read with `date -r … +%s%6N`, the same digit-only
format the start time already used (`date -d … +%s%6N` on systemd's
fixed English timestamp), so neither side has a separator for a locale
to change.

A value that still does not read as digits — an unparsable start time,
a missing file — now restarts nothing and logs at `err`. Skipping on
doubt rather than restarting on doubt: the file's mtime is kept, so a
genuinely changed credential still restarts its consumer on the first
run that can read both times, whereas restarting on doubt restarts it
on every run, which is this bug. Both reads also fall back to empty
instead of aborting the caller's `set -e` script.

`script-test-refresh-consumer` runs the rendered helper under
`de_DE.UTF-8` against a stub `systemctl`, and checks first that `stat`
really prints a comma there. The helper on main fails 14 of its
assertions.

Fixes #5230
2026-10-13 17:00:56 +02:00
..
agent-bao-fetch.nix agents: re-pull the agent's own bao mTLS leaf on a timer 2026-10-11 10:00:43 +02:00
agent-bao-fetch.sh agents: swap the agent's bao leaf in with one rename 2026-10-11 10:00:43 +02:00
agent-hive-facts.nix agents: login shells read the hive facts too; test the readers 2026-10-12 10:52:21 +02:00
agent-hive-facts.sh agents: login shells read the hive facts too; test the readers 2026-10-12 10:52:21 +02:00
agent-memory-cap.nix agents: hand over the kept drop-in's cap, warn at boot without one 2026-10-12 10:59:12 +02:00
agent-memory-cap.sh agents: always write the memory cap, infinity for none 2026-10-12 10:59:12 +02:00
nats-render-config.nix swarm-nats: take the callout issuer and user keys from the store 2026-10-06 14:53:33 +02:00
nats-render-config.sh swarm-nats: take the callout issuer and user keys from the store 2026-10-06 14:53:33 +02:00
refresh-consumer.nix refresh-consumer: compare mtimes locale-independently so an unchanged secret doesn't restart its unit 2026-10-13 17:00:56 +02:00
refresh-consumer.sh refresh-consumer: compare mtimes locale-independently so an unchanged secret doesn't restart its unit 2026-10-13 17:00:56 +02:00