Skip to content

Block agent bootstrap on existing host deployments#426

Merged
bcho merged 9 commits into
mainfrom
copilot/fix-preflight-check-for-existing-deployment
Jul 13, 2026
Merged

Block agent bootstrap on existing host deployments#426
bcho merged 9 commits into
mainfrom
copilot/fix-preflight-check-for-existing-deployment

Conversation

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

unbounded-agent preflight and start did not detect existing or partially removed host deployments. This could allow bootstrap to continue with stale nspawn or agent state instead of requiring an explicit reset.

  • Existing deployment detection

    • Adds a host preflight check for prior deployment artifacts.
    • Detects registered kube1 / kube2 nspawn machines, machine rootfs directories, nspawn configs, service overrides, bpffs paths, applied configs, and agent daemon artifacts.
  • Start-time guard

    • Runs the same detection before start performs any host mutation.
    • Returns reset guidance when stale state is found.
  • Operator guidance

    • Error output now says a node reset is needed before retrying preflight or start, without hard-coding a product-specific reset command.

Example failure:

existing node deployment detected; node reset is needed before running start again

Copilot AI changed the title [WIP] Fix preflight and start to check for existing deployment on host Block agent bootstrap on existing host deployments Jul 8, 2026
Copilot AI requested a review from bcho July 8, 2026 18:58
Copilot finished work on behalf of bcho July 8, 2026 18:58

@bcho bcho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot please remove hard coded unbounded-ageant reset mentioning

Comment thread pkg/agent/phases/host/preflight_existing_deployment.go Outdated

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot please remove hard coded unbounded-ageant reset mentioning

Addressed in f99a6ab by replacing the hard-coded unbounded-agent reset guidance with product-neutral node reset wording.

Copilot finished work on behalf of bcho July 8, 2026 20:33
Copilot AI requested a review from bcho July 8, 2026 20:33

@bcho bcho left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot test is failing

Error: existing-deployment]: existing node deployment artifact detected (bpffs mount path): bpffs mount path /run/bpffs/kube1; node reset is needed before running preflight or start again (target: /run/bpffs/kube1)

Copilot AI commented Jul 8, 2026

Copy link
Copy Markdown
Contributor Author

@copilot test is failing

Error: existing-deployment]: existing node deployment artifact detected (bpffs mount path): bpffs mount path /run/bpffs/kube1; node reset is needed before running preflight...

Fixed in 7f1cf3f by adding bpffs mount cleanup to daemon AgentReset, so reset removes /run/bpffs/kube1/kube2 before e2e re-runs preflight.

Copilot AI requested a review from bcho July 8, 2026 23:49
Copilot finished work on behalf of bcho July 8, 2026 23:49
Copilot finished work on behalf of bcho July 10, 2026 18:54
Copilot finished work on behalf of bcho July 10, 2026 19:01
@bcho
bcho marked this pull request as ready for review July 10, 2026 20:16
@bcho
bcho requested a review from a team July 10, 2026 20:16
@bcho
bcho enabled auto-merge July 10, 2026 20:19
Copilot finished work on behalf of bcho July 10, 2026 22:21
Copilot AI requested a review from bcho July 10, 2026 22:21
@bcho
bcho added this pull request to the merge queue Jul 13, 2026
Merged via the queue into main with commit c1003a3 Jul 13, 2026
39 of 40 checks passed
@bcho
bcho deleted the copilot/fix-preflight-check-for-existing-deployment branch July 13, 2026 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

agent: preflight and start should check for existing deployment on the host

3 participants