feat(paper): stay inert when no Agones SDK sidecar is present#40
Merged
feat(paper): stay inert when no Agones SDK sidecar is present#40
Conversation
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>
fd88bf6 to
c08dfe1
Compare
|
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
The paper baseImage on Grounds bundles
plugin-agones-paperinto 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 tohttp://localhost:9358loop 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
Skipped Agones plugin (reason=no_sidecar, AGONES_SDK_HTTP_PORT_unset); pod is not a GameServerexactly once and no SocketException stack traces afterwards.Started Agones plugin successfully (platform=paper)and state transitions still work as before.🤖 Generated with Claude Code