Skip to content

feat(paper): stay inert when no Agones SDK sidecar is present#40

Merged
hbrombeer merged 1 commit intomainfrom
feat/inert-without-sidecar
May 6, 2026
Merged

feat(paper): stay inert when no Agones SDK sidecar is present#40
hbrombeer merged 1 commit intomainfrom
feat/inert-without-sidecar

Conversation

@hbrombeer
Copy link
Copy Markdown
Member

Summary

The paper baseImage on Grounds bundles plugin-agones-paper into every pod by default — including plain plugin-paper Deployments that aren't wrapped in an Agones GameServer / Fleet. Those pods don't get the SDK sidecar (the mutating webhook only injects it on GameServer-managed pods), so the plugin's hardcoded calls to http://localhost:9358 loop on SocketException + log SEVERE every 10s. Loud noise for an inert feature.

Use AGONES_SDK_HTTP_PORT (which the webhook always sets on the GameServer container's env) as the activation gate: present → real init (current behaviour), absent → log one info line and return. Mirror of the pattern plugin-grounds-platform already uses for its own required env vars.

Test plan

  • After release, deploy to a plain Paper pod (no Agones GameServer wrapper) — console shows Skipped Agones plugin (reason=no_sidecar, AGONES_SDK_HTTP_PORT_unset); pod is not a GameServer exactly once and no SocketException stack traces afterwards.
  • Deploy to an Agones GameServer pod — console shows Started Agones plugin successfully (platform=paper) and state transitions still work as before.

🤖 Generated with Claude Code

The paper baseImage on Grounds bundles plugin-agones-paper into every
pod by default — including plain plugin-paper Deployments that aren't
wrapped in an Agones GameServer / Fleet. Those pods don't get the SDK
sidecar (the Agones mutating webhook only injects it on
GameServer-managed pods), so the plugin's hardcoded calls to
http://localhost:9358 loop on SocketException + log SEVERE every
10 seconds — loud noise for an inert feature.

Use the `AGONES_SDK_HTTP_PORT` env var as the activation gate. The
Agones webhook always sets it on the GameServer container's env,
right alongside the volume mount that backs the SDK socket. Present
→ real init (existing behaviour); absent → log a single info line
("Skipped Agones plugin (reason=no_sidecar, AGONES_SDK_HTTP_PORT_unset)
; pod is not a GameServer") and return.

Mirror of the pattern plugin-grounds-platform already uses for its own
required env vars: detect missing context, log once, stay quiet, never
crash.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hbrombeer hbrombeer force-pushed the feat/inert-without-sidecar branch from fd88bf6 to c08dfe1 Compare May 6, 2026 08:05
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 6, 2026

@hbrombeer hbrombeer merged commit a37cf40 into main May 6, 2026
3 checks passed
@hbrombeer hbrombeer deleted the feat/inert-without-sidecar branch May 6, 2026 08:15
hbrombeer added a commit to groundsgg/containers that referenced this pull request May 6, 2026
The paper baseImage is consumed exclusively by `type: plugin-paper`
workloads (per BASE_IMAGE_TO_TYPE in grounds-forge/src/buildrunner/
manifest.ts). Forge renders those as plain Deployments — never as
Agones-managed GameServers. The Agones SDK sidecar is only injected
on GameServer-managed pods, so plugin-agones-paper in this image
talks to a localhost:9358 that never exists. The plugin's own
docs accept this state (`Errors are logged at severe level`) and
groundsgg/plugin-agones#40 makes it inert when the env var is unset,
but the simpler fix is to not bundle it here at all.

If a future `type: gamemode` workload uses a Paper-based baseImage
(rather than the current minestom-based one), plugin-agones-paper
belongs in that image. Tracked separately.

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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