feat: inspect-image reads what a game's image needs
`gbrgames inspect-image -game <id>` pulls the image and reads, without
starting the game (probe runs with --network none and bypasses the
entrypoint): its user, accounts, home folder owners and modes, tools
(java, steamcmd, proton...), startup scripts and the variables they read.
It then checks the template against those facts:
- an image built around its own user (a locked home owned by another uid,
or a declared USER) needs a matching containerUser
- the startup command must read settings under the names the node gives
them (the agent's toUpperSnakeCase), and must not read unset variables
that have no default
On the template from the first commit it reports both ARK bugs found by
boot tests today (uid 25000; ${RCON_PORT} vs RCONPORT); the current five
templates pass. Boot tests now run it first, so such templates fail in
seconds instead of after a boot. -json prints the facts for tooling.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
309c667735
commit
40e7372dab
5 files changed
+652
-1
No files matched your search
@@ -4,6 +4,7 @@
|
||||
// go run ./cmd/gbrgames import export.json # write games/<id>/ from GET /api/v1/admin/games
|
||||
// go run ./cmd/gbrgames export -out p.json # build the games_published payload CI sends to the panel
|
||||
// go run ./cmd/gbrgames boottest-payload ID # build the deploy message the node-agent's BootTest runs
|
||||
// go run ./cmd/gbrgames inspect-image -game ID # read the image's facts and check the template against them
|
||||
package main
|
||||
|
||||
import (
|
||||
@@ -25,6 +26,8 @@ func main() {
|
||||
err = runExport(os.Args[2:])
|
||||
case "boottest-payload":
|
||||
err = runBootTestPayload(os.Args[2:])
|
||||
case "inspect-image":
|
||||
err = runInspectImage(os.Args[2:])
|
||||
default:
|
||||
usage()
|
||||
}
|
||||
@@ -35,6 +38,6 @@ func main() {
|
||||
}
|
||||
|
||||
func usage() {
|
||||
fmt.Fprintln(os.Stderr, "usage: gbrgames validate [-games DIR] | import [-games DIR] [-all] EXPORT.json | export [-repo R] [-commit SHA] [-out FILE] | boottest-payload [-out FILE] ID")
|
||||
fmt.Fprintln(os.Stderr, "usage: gbrgames validate [-games DIR] | import [-games DIR] [-all] EXPORT.json | export [-repo R] [-commit SHA] [-out FILE] | boottest-payload [-out FILE] ID | inspect-image [-game ID] [-json] [-no-pull] [IMAGE]")
|
||||
os.Exit(2)
|
||||
}
|
||||
Reference in new issue
Block a user