Skip to content

Make reset restore a reinstallable direct agent binary #311

Description

@bcho

Description

aks-flex-node reset removes the agent service and node runtime state but intentionally retains the managed blue/green binary layout:

  • /usr/local/bin/aks-flex-node remains a symlink to aks-flex-node-current.
  • /usr/local/lib/aks-flex-node retains the current, last-good, blue, and green paths.

This makes a clean reinstall ambiguous. scripts/install.sh must either reject the retained managed link or special-case a reset host by deleting the inactive layout before installing a direct binary. It also caused the rejoin path exercised by PR #308 to invoke the installer against a retained managed link.

Expected behavior

After reset, the agent should remain callable but be in a state that supports a clean installer retry. Consider having reset atomically restore the active agent as a regular /usr/local/bin/aks-flex-node file and remove the managed layout after the service has stopped.

This would preserve the aks-flex-node command while making the post-reset state equivalent to a pre-managed installation. Normal in-place upgrades while the service is installed should continue to use AgentUpgrade.

Acceptance criteria

  • aks-flex-node reset leaves an executable agent command available.
  • /usr/local/bin/aks-flex-node is no longer a managed-layout symlink after a successful reset.
  • The inactive managed blue/green layout is removed safely.
  • Running scripts/install.sh after reset succeeds without installer-specific managed-layout cleanup.
  • Reset remains idempotent and has coverage for direct, managed, and already-reset binary layouts.

Context

Follow-up to #307 and PR #308.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions