You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ami create: per-instance spored/plugin state (plugins.json, job-array env, peer files) is still baked into images #1241
Found while fixing #1057 (PR #1240). That fix cleans the --command run state before spawn ami create snapshots: the completion file, /tmp/SPAWN_*, and the rendered and embedded command. Other per-instance state the bootstrap writes also gets baked into an image, and an instance launched from that image inherits it.
/etc/spawn/plugins.json: the bootstrap writes it only when the launch declares plugins (pkg/launcher/bootstrap.go, if len(cfg.Plugins) > 0). It never removes it. spored reads it on every startup (pkg/provider/ec2.goloadPluginDeclarations, file optional). So an instance launched from an image of a plugin-bearing instance, with no plugins of its own, still loads the parent's plugin declarations.
/var/lib/spored/plugins: the on-instance plugin state store (pkg/plugin/state.goNewDiskStateStore) and /var/lib/spored/queue-state.json (pkg/agent/queue_runner.go) both persist on the root volume.
/etc/profile.d/job-array.sh and /etc/spawn/job-array-peers.json / /etc/spawn/pipeline-peers.json: the parent's array identity and peer list land in login shells and peer discovery on the child.
/var/lib/spored/compute-checkpoint.json carries instance_id (pkg/agent/computecheckpoint.go), so it is probably harmless. Listed here so whoever picks this up can confirm.
Not verified
I worked this out from reading the code. I have not reproduced it on an instance launched from an image.
Options
Either extend launcher.ImageStateCleanupScript (#1057), or have the bootstrap and spored discard inherited state when the instance ID differs from the one that wrote it. The second also covers images made outside spawn ami create.
Activity
fix(ami): discard per-instance state inherited from an image's source…
fix: tree-walk test flake (#1334); discard per-instance state inherit…