mirror of
https://github.com/floci-io/floci.git
synced 2026-11-27 07:39:24 -05:00
EksService restores persisted clusters in @PostConstruct, but CDI creates the bean on first use. After a restart no cluster's k3s container came back until something called the EKS API, so workloads on it stayed down. EmulatorLifecycle now calls EksService.restorePersistedRuntime from onHttpStart, after the start and ready hooks. It waits for the IMDS server to start, because a recreated cluster's Pod Identity and IMDS relays probe Floci's HTTP port and IMDS before they route pod traffic there. It runs after the hooks so they and the ready line don't wait minutes for k3s. If the restore throws, it is logged and the emulator stays up; EKS requests retry creating the service, as before. EksBootRestoreIntegrationTest boots a fresh application with EKS out of mock mode and checks EksService was created without an EKS request, as EcsBootReconcilerIntegrationTest does for ECS. Its profile pins the HTTP port, since onHttpStart acts only on quarkus.http.port. Co-authored-by: Robin Baeckman <27041454+RobinBaeckman@users.noreply.github.com>