forked from mtusi2026/mtusi2026lab7
fix(pki): repair active identities without container startup overhead
This commit is contained in:
+16
-1
@@ -36,6 +36,21 @@ print('Operator installed a scoped short-lived leaf')
|
||||
def install(role, data):
|
||||
payload = {**data, "reload_lb": role == "lb"}
|
||||
args = ["--profile", "maintenance"] if role == "migrate" else []
|
||||
service = "identity-" + role
|
||||
if compose(*args, "ps", "--status", "running", "-q", service):
|
||||
# The agent already owns this identity volume. Install with its own UID
|
||||
# and atomic generation switch, without starting a second container.
|
||||
compose(
|
||||
*args,
|
||||
"exec",
|
||||
"-T",
|
||||
service,
|
||||
"python",
|
||||
"-c",
|
||||
INSTALL,
|
||||
input=json.dumps(payload),
|
||||
)
|
||||
return
|
||||
compose(
|
||||
*args,
|
||||
"run",
|
||||
@@ -44,7 +59,7 @@ def install(role, data):
|
||||
"-T",
|
||||
"--entrypoint",
|
||||
"python",
|
||||
"identity-" + role,
|
||||
service,
|
||||
"-c",
|
||||
INSTALL,
|
||||
input=json.dumps(payload),
|
||||
|
||||
Reference in New Issue
Block a user