Only config-sync: starting showed in kubectl logs — the per-sync lines never appeared. Cause: busybox sh block-buffers stdout when it's a pipe (as under kubelet), so lines after the first can sit unflushed for the lifetime of the loop.
Fix
log() now writes to stderr (unbuffered; still captured into the container log) → lines reach kubectl logs immediately.
Added a one-time initial check: config in sync with origin/main at <sha> line, so an idle loop (nothing to sync) is still observably alive instead of looking silent after "starting".
Validated: sh -n clean, kubectl kustomize builds. Rolls on merge via Flux (the deployment is unchanged, but the configMap script content changes; a rollout restart may be needed since the script configMap has disableNameSuffixHash).
## Problem
Only `config-sync: starting` showed in `kubectl logs` — the per-sync lines never appeared. Cause: **busybox `sh` block-buffers stdout when it's a pipe** (as under kubelet), so lines after the first can sit unflushed for the lifetime of the loop.
## Fix
- `log()` now writes to **stderr** (unbuffered; still captured into the container log) → lines reach `kubectl logs` immediately.
- Added a one-time **`initial check: config in sync with origin/main at <sha>`** line, so an idle loop (nothing to sync) is still observably alive instead of looking silent after "starting".
Validated: `sh -n` clean, `kubectl kustomize` builds. Rolls on merge via Flux (the deployment is unchanged, but the configMap script content changes; a `rollout restart` may be needed since the script configMap has `disableNameSuffixHash`).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Only the "starting" line surfaced in `kubectl logs`: busybox sh block-buffers
stdout when it's a pipe, so subsequent lines could sit unflushed for the life of
the loop. Log to stderr instead (unbuffered; still captured in the container
log). Also emit a one-time "initial check: config in sync" line so an idle loop
is observably alive even when there's nothing to sync.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GgbyKgrN1yYWrkAA32rJE5
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Problem
Only
config-sync: startingshowed inkubectl logs— the per-sync lines never appeared. Cause: busyboxshblock-buffers stdout when it's a pipe (as under kubelet), so lines after the first can sit unflushed for the lifetime of the loop.Fix
log()now writes to stderr (unbuffered; still captured into the container log) → lines reachkubectl logsimmediately.initial check: config in sync with origin/main at <sha>line, so an idle loop (nothing to sync) is still observably alive instead of looking silent after "starting".Validated:
sh -nclean,kubectl kustomizebuilds. Rolls on merge via Flux (the deployment is unchanged, but the configMap script content changes; arollout restartmay be needed since the script configMap hasdisableNameSuffixHash).🤖 Generated with Claude Code