Skip to content

squid rolls when squid.conf or its reload wrapper changes (fix for #2216) - #2287

Draft
massimo-sandboxaq wants to merge 1 commit into
hosted-agents-v2-prfrom
work/squid-rolls-on-config
Draft

massimo-sandboxaq wants to merge 1 commit into
hosted-agents-v2-prfrom
work/squid-rolls-on-config

Conversation

@massimo-sandboxaq

Copy link
Copy Markdown
Collaborator

A fix for #2216's squid deployment, found while testing on a dev slot.

The problem

  • squid reads squid.conf (squid-conf) and its reload wrapper (squid-reload) only when its pod starts. The wrapper watches box files and logins, not those two.
  • So applying a change to either left the running squid pods on the old version until someone ran kubectl rollout restart.
  • When a change to the Deployment rolled the pods in the same apply, a new pod could start before kubelet had the new ConfigMap, and run the old wrapper. That happened on a dev slot: one of two new pods ran the previous wrapper until restarted.

The fix: fill-placeholders.py writes a hash of the two filled ConfigMaps on squid's pod template, as switch.dev/squid-config (the __SQUID_CONFIG_HASH__ placeholder). A change to either changes the pod template and rolls the pods, and nothing else does. Because it's computed from the filled text, values such as the agents' subnet count too.

The cluster contract gains a placeholder fill for the new token.

Tested

  • The hosted controller suite passes, with a new fill test: the hash is stable across runs and changes when squid.conf does. The contract was regenerated.
  • A filled 50-egress-proxy.yaml passes a server-side dry run on a dev slot's box cluster.

🤖 Generated with Claude Code

squid reads both only when its pod starts, and the wrapper watches neither, so
applying a change to either left the running pods on the old ones until
someone restarted them. And since the ConfigMaps and the Deployment are applied
together, a pod starting mid-apply could take the old wrapper (seen on a dev
slot). fill-placeholders.py now writes a hash of the two filled ConfigMaps on
squid's pod template (switch.dev/squid-config), so a change to either rolls
the pods, and nothing else does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant