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.
Description
aks-flex-node resetremoves the agent service and node runtime state but intentionally retains the managed blue/green binary layout:/usr/local/bin/aks-flex-noderemains a symlink toaks-flex-node-current./usr/local/lib/aks-flex-noderetains the current, last-good, blue, and green paths.This makes a clean reinstall ambiguous.
scripts/install.shmust 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-nodefile and remove the managed layout after the service has stopped.This would preserve the
aks-flex-nodecommand 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 resetleaves an executable agent command available./usr/local/bin/aks-flex-nodeis no longer a managed-layout symlink after a successful reset.scripts/install.shafter reset succeeds without installer-specific managed-layout cleanup.Context
Follow-up to #307 and PR #308.