Repository navigation
feat(agent): show the config error below the pairing QR code - #5227
Conversation
A config that is found but fails to read was reported by AutoInstall before Install cleared the screen to draw the branding and the QR code, so the operator never saw it. AutoInstall now hands the scan error back to its caller, and Install prints it again as the last thing on the pairing screen, below the QR code and the interfaces, or before dropping to a shell when there are no providers. A node booted with no config at all stays quiet: config.Scan reports that as an empty config, not as an error. Fixes kairos-io#3248 Co-authored-by: Itxaka <itxakaserrano@gmail.com> Signed-off-by: itxaka-agent <itxaka-agent@users.noreply.github.com>
QEMU verification and test run for 104193e. Booted the v4.3.0 Hadron live ISO under KVM with a broken master, broken config: QR code and This branch, same config: red error under the QR code and interfaces line. This branch, no config at all: QR code only, no notice. Unit tests: Blob SHAs: qemu-before 524b2dc, qemu-after 4a275c8, qemu-noconfig e16e615, tests-agent d511976. |
|
Picking this up for QA. |
QA Result: PASS
(A) master, broken config: (B) this PR, broken config: (C) this PR, valid config: Summary: On a real live boot of a standard image, the installer unit now shows why a config was rejected, under the pairing QR code where #3248 asked for it. A valid config still shows no notice, and the QR code still decodes. Not covered: the "No providers found" branch (core images) was not booted; it is covered by the PR's unit specs only. Also seen, not caused by this PR: with a 1024x768 console the two extra lines scroll the top border of the banner box off screen in (B). The box text is still visible. |







When a node boots with a cloud-config that is found but fails to read,
AutoInstallprinted the error andInstallcleared the screen right after, so the QR code was the only thing left and nothing said the config was broken.AutoInstallnow returns the scan error separately from the install error.Installtakes it and prints it as the last thing on the pairing screen, below the QR code and the interfaces line, or just before dropping to a shell when no provider is registered. A node with no config at all stays quiet:config.Scanreports that as an empty config, not as an error. Theinstallcommand passes the error through;interactive-installis unchanged.New specs check the notice text, that it comes after the QR code and
Interfaces:, that it still shows with no QR code, and that it is silent without an error.AutoInstallspecs cover the missing-config and broken-config cases. The ordering spec fails if the print moves above the QR code.Booted the v4.3.0 Hadron live ISO with
install.ssh_hardening: trueand no users: master shows the QR code with no error, this branch shows the red error under it, and a node with no config shows only the QR code. Screenshots are in the next comment. The agent binary was swapped inside the running guest andkairos-agent installwas run by hand, not through the GRUB boot path.Left out on purpose: schema warnings outside strict mode, which are still printed before the clear, and the
interactive-installscreen.Fixes: #3248
Audit summary: #3248 (comment)
Signed-off-by: itxaka-agent itxaka-agent@users.noreply.github.com