feat: add host agent version drift flag in privateKey list#4589
Open
leebrouse wants to merge 5 commits intokoderover:mainfrom
Open
feat: add host agent version drift flag in privateKey list#4589leebrouse wants to merge 5 commits intokoderover:mainfrom
leebrouse wants to merge 5 commits intokoderover:mainfrom
Conversation
Signed-off-by: YuTang Song <2313186065@qq.com>
PetrusZ
suggested changes
Apr 3, 2026
| func getCurrentZadigAgentVersion() (string, error) { | ||
| ns := commonconfig.Namespace() | ||
| kubeClient := krkubeclient.Client() | ||
| configMap, found, err := getter.GetConfigMap(ns, "aslan-config", kubeClient) |
Contributor
There was a problem hiding this comment.
这个函数跟getZadigAgentVersion重复了
Signed-off-by: YuTang Song <2313186065@qq.com>
PetrusZ
suggested changes
Apr 3, 2026
| func GetZadigAgentVersion() (string, error) { | ||
| ns := commonconfig.Namespace() | ||
| kubeClient := krkubeclient.Client() | ||
| configMap, found, err := getter.GetConfigMap(ns, "aslan-config", kubeClient) |
Contributor
There was a problem hiding this comment.
使用viper.GetString(setting.ZadigAgentVersion)这种方法,从环境变量里读就行,不需要读configmap,再改一下吧
…e/agent_vesion_monitor
Signed-off-by: YuTang Song <2313186065@qq.com>
PetrusZ
suggested changes
Apr 3, 2026
| if version != "" { | ||
| return version, nil | ||
| } | ||
| version := viper.GetString(setting.ZadigAgentRepoURL) |
Signed-off-by: YuTang Song <2313186065@qq.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_versionand system target version, so the frontend could not reliably show upgrade reminders.What is changed and how it works?
ListPrivateKeysinpkg/microservice/aslan/core/system/service/private_key.go.aslan-configkeyZADIG_AGENT_VERSION.key.Agent != nil && key.ScheduleWorkflow):agent.zadig_versionagent.need_updateby comparingagent.agent_versionvsagent.zadig_versionvprefix before comparing, to avoid false mismatch (v2.5.1vs2.5.1).need_update = trueneed_update = falseDoes this PR introduce a user-facing change?
This change is