Skip to content

Installer: a first-install mode answer no longer discards a forced --netboot-proto - #2066

Merged
fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/install-mode-keeps-forced-netboot
Nov 4, 2026
Merged

fog-workflows[bot] merged 1 commit into
dev-branchfrom
fix/install-mode-keeps-forced-netboot

Conversation

@mastacontrola

Copy link
Copy Markdown
Member

Problem

On a first interactive install with --netboot-proto <x> and no other mode flag, the install-mode prompt still runs. It recorded its answer as FOG_install_mode unconditionally, overriding the installer's rule that a discrete transport flag clears the mode. On the next run the installer seeded that mode, _applyInstallMode wrote the preset's BOOT_url_proto, and _resolveNetbootProto kept it because BOOT_url_proto_forced was still yes. The forced netboot protocol was lost for good.

Found while working on #2064 / #2065.

Change

  • The clearing rule moved into _recordInstallMode() in lib/common/functions.sh. bin/installfog.sh and promptInstallMode both call it.
  • For --netboot-proto, the rule clears the mode only when the forced value differs from the preset's. A matching value moves nothing. Clearing then would lose http-only, whose HTTP web UI is recorded only in the mode name.

Behavior change on the flag path: --install-mode X --netboot-proto Y, where Y equals the preset's netboot value, now keeps the mode instead of clearing it. The next run produces the same keys either way. For http-only it also keeps the HTTP web UI, which it used to lose.

Tests

tests/install-settings-resolution.test.sh:

  • A two-run scenario through the real functions: a prompt answer with a forced netboot value, then a plain upgrade. The forced value survives.
  • http-only with a matching forced http keeps both the mode and the HTTP web UI.
  • A source pin that promptInstallMode records through _recordInstallMode.
  • The existing replay now calls the real helper instead of restating it.

Each new check was made to fail by reintroducing the old behavior. A simulation of every prompt answer (1-4) with each forced value (http, https) keeps the forced netboot value on the second run in all 8 cases.

Not in this PR

  • http-only with --netboot-proto https still clears the mode, so the web UI returns to https on the next run. The flag path already did this before this change, and the shape contradicts itself. A comment in _recordInstallMode names it.
  • Servers already in the bad state cannot be recovered automatically, because the original forced value is stored nowhere. Re-running the installer once with --netboot-proto <x> sets it and clears the mode.

🤖 Generated with Claude Code

…netboot-proto

installfog.sh clears FOG_install_mode when a discrete transport flag is
given, but promptInstallMode still runs with --netboot-proto and recorded
its answer unconditionally. The next run seeded that mode,
_applyInstallMode wrote the preset's BOOT_url_proto, and
_resolveNetbootProto kept it because BOOT_url_proto_forced was yes. The
forced protocol was lost for good.

Both call sites now record through _recordInstallMode. For
--netboot-proto it clears the mode only when the forced value differs
from the preset's: a matching value moves nothing, and clearing then
would lose http-only, whose HTTP web UI lives only in the mode name.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@fog-workflows
fog-workflows Bot enabled auto-merge November 4, 2026 22:00
@fog-workflows
fog-workflows Bot added this pull request to the merge queue Nov 4, 2026
Merged via the queue into dev-branch with commit 2f4a0cd Nov 4, 2026
12 checks passed
@fog-workflows
fog-workflows Bot deleted the fix/install-mode-keeps-forced-netboot branch November 4, 2026 22:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant