One fix in lo kubehz deploy and lo kubehz register, in Go and bash (#247). It keeps the agent on the cluster record that register made. No change to the piped output of the other commands.
Fixes
- The bind Secret goes in before the agent.
lo kubehz deploynow stages thekubehz-agent-bindSecret before it applies the agent CronJob, in both the operator and the cronjob modes. Before, a CronJob run in the gap between the two could register without the bind secret, and the agent then reported to a second record instead of the announced row.- If staging the Secret fails while
.kubehz-bindexists, the deploy stops before it changes the agent. The error says what changed so far. - Without
.kubehz-bind, the deploy warns: the agent registers a separate pending row, and you claim that row withlo kubehz claim-code. --dry-runsays that the Secret goes in first. It never prints the value.
- If staging the Secret fails while
- Every register call sends the stored bind secret. A re-run of
lo kubehz registernow presents the secret from.kubehz-bind, so the platform keeps the same cluster record. lo sends the value only when the file is a readable regular file of exactly 64 lowercase hex characters. - The bind secret is written in place. lo replaces
.kubehz-bindunder its own name with mode 0600, so the file is always covered by the.gitignoreline thatlo init projectwrites. A directory, or a link to one, in that place is refused with a warning.
Upgrade
- The deploy now needs
patchon Secrets in thekubehz-systemnamespace, andcreatewhen the Secret is new. It no longer needsdelete. The built-inadminandeditroles have these verbs. A kubeconfig withoutpatchused to warn and now stops the deploy with the verbs named. - A cluster whose agent already reports to a separate record keeps it. Claim that record with
lo kubehz claim-code.