Skip to content

feat: add host agent version drift flag in privateKey list#4589

Merged
jamsman94 merged 7 commits intokoderover:mainfrom
leebrouse:feature/agent_vesion_monitor
Apr 15, 2026
Merged

feat: add host agent version drift flag in privateKey list#4589
jamsman94 merged 7 commits intokoderover:mainfrom
leebrouse:feature/agent_vesion_monitor

Conversation

@leebrouse
Copy link
Copy Markdown
Contributor

@leebrouse leebrouse commented Apr 2, 2026

What this PR does / Why we need it:

This PR enables agent version visibility and version drift warning for Host Management.
Previously, the host list API did not provide a direct comparison result between host agent_version and system target version, so the frontend could not reliably show upgrade reminders.

What is changed and how it works?

  • Updated ListPrivateKeys in pkg/microservice/aslan/core/system/service/private_key.go.
  • Added logic to fetch current target agent version from ConfigMap aslan-config key ZADIG_AGENT_VERSION.
  • For each host entry:
    • Keep existing private key encryption behavior.
    • Only when host is in agent mode (key.Agent != nil && key.ScheduleWorkflow):
      • fill agent.zadig_version
      • compute agent.need_update by comparing agent.agent_version vs agent.zadig_version
  • Added version comparison helper:
    • strips v prefix before comparing, to avoid false mismatch (v2.5.1 vs 2.5.1).
  • Result:
    • if versions differ: need_update = true
    • if versions are equal: need_update = false

Does this PR introduce a user-facing change?

  • API change
  • database schema change
  • upgrade assistant change
  • change in non-functional attributes such as efficiency or availability
  • fix of a previous issue

This change is Reviewable

Signed-off-by: YuTang Song <2313186065@qq.com>
Comment thread pkg/microservice/aslan/core/system/service/private_key.go Outdated
Signed-off-by: YuTang Song <2313186065@qq.com>
@leebrouse leebrouse requested a review from PetrusZ April 3, 2026 03:44
Comment thread pkg/microservice/aslan/config/config.go Outdated
@github-actions github-actions bot added the common label Apr 3, 2026
Comment thread pkg/microservice/aslan/config/config.go Outdated
Signed-off-by: YuTang Song <2313186065@qq.com>
@leebrouse leebrouse requested a review from PetrusZ April 3, 2026 09:28
Signed-off-by: YuTang Song <2313186065@qq.com>
…ter panics

Signed-off-by: YuTang Song <2313186065@qq.com>
@jamsman94 jamsman94 merged commit 58f4926 into koderover:main Apr 15, 2026
4 checks passed
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.

3 participants