Skip to content

Commit ff6dc68

Browse files
acceptance: pass the chart's connect address as a flag
The chart now passes acceptance.connectAddr as --connect-addr instead of an env var. A relay image whose probe predates the option rejects the unknown flag and the run fails, instead of checking the public URL and reporting success. The README states the image requirement. The binary tests clear BUZZ_ACCEPTANCE_CONNECT_ADDR so a developer shell cannot redirect them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Luke Tornquist <tornquist@squareup.com>
1 parent c692173 commit ff6dc68

4 files changed

Lines changed: 14 additions & 6 deletions

File tree

‎crates/buzz-test-client/tests/e2e_acceptance.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ fn probe_with_env(args: &[&str], envs: &[(&str, &str)]) -> (Output, Vec<String>)
6262
.env_remove("BUZZ_PRIVATE_KEY_FILE")
6363
.env_remove("BUZZ_ACCEPTANCE_ASSERTION_FILE")
6464
.env_remove("BUZZ_ACCEPTANCE_STATSD_ADDR")
65+
.env_remove("BUZZ_ACCEPTANCE_CONNECT_ADDR")
6566
.env_remove("BUZZ_RELAY_URL")
6667
.envs(envs.iter().copied())
6768
.stdout(Stdio::piped())

‎deploy/charts/buzz/README.md‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,9 @@ image predates the probe.
531531
of the URL's host, for a probe that runs where the public host is not
532532
reachable, such as inside the relay's cluster. The URL still sets the `Host`
533533
header, the NIP-42 relay tag and the NIP-11 request's `Host`, so the relay
534-
serves the same community.
534+
serves the same community. The chart passes it as `--connect-addr`, so the
535+
relay image's probe must have that flag. An older probe exits with an error
536+
instead of checking the public URL.
535537
- `acceptance.privateKeySecret.name` names a Secret with the probe's key
536538
(hex or nsec), or `acceptance.privateKeyFile` names a file an init
537539
container writes. Set exactly one: the chart fails to render with neither.

‎deploy/charts/buzz/templates/acceptance-cronjob.yaml‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ spec:
6666
- {{ $a.metricPrefix | quote }}
6767
- --tag
6868
- {{ printf "probe_revision:%s" (include "buzz.imageRevision" .) | quote }}
69+
{{- with $a.connectAddr }}
70+
# A flag, not an env var: a probe older than this option
71+
# rejects the unknown flag instead of dialing the public URL.
72+
- --connect-addr
73+
- {{ . | quote }}
74+
{{- end }}
6975
{{- range $a.tags }}
7076
- --tag
7177
- {{ . | quote }}
@@ -77,9 +83,6 @@ spec:
7783
fieldRef:
7884
fieldPath: status.hostIP
7985
- { name: BUZZ_RELAY_URL, value: {{ default .Values.relayUrl $a.relayUrl | quote }} }
80-
{{- with $a.connectAddr }}
81-
- { name: BUZZ_ACCEPTANCE_CONNECT_ADDR, value: {{ . | quote }} }
82-
{{- end }}
8386
{{- with $a.statsdAddr }}
8487
- { name: BUZZ_ACCEPTANCE_STATSD_ADDR, value: {{ . | quote }} }
8588
{{- end }}

‎deploy/charts/buzz/tests/acceptance_test.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,8 @@ tests:
172172
- example.acceptance
173173
- --tag
174174
- probe_revision:sha256:0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef
175+
- --connect-addr
176+
- relay.internal:80
175177
- --tag
176178
- env:staging
177179
- --tag
@@ -189,11 +191,11 @@ tests:
189191
content:
190192
name: BUZZ_RELAY_URL
191193
value: wss://probe.example.com
192-
- contains:
194+
- notContains:
193195
path: spec.jobTemplate.spec.template.spec.containers[0].env
194196
content:
195197
name: BUZZ_ACCEPTANCE_CONNECT_ADDR
196-
value: relay.internal:80
198+
any: true
197199
- contains:
198200
path: spec.jobTemplate.spec.template.spec.containers[0].env
199201
content:

0 commit comments

Comments
 (0)