Prefer getServerInfo
gRPC for KAS version used on for Register Agent UI
-
Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA. As a benefit of being a GitLab Community Contributor, you receive complimentary access to GitLab Duo.
What does this MR do and why?
The 4th (and last one!) MR to close #458891.
While the previous 3 MRs migrates UIs that simply display KAS version, this 4th MR migrates the recommended agentk version in Connect a Kubernetes cluster
dialog.
References
The logic for deciding which agentk
version to recommended:
- Old logic from !149794 (merged): Check the
GITLAB_KAS_VERSION
file first, if it's a valid version, use it without patch; If it's a commit, use GitLab version without patch. -
New logic in this MR: Only looking at the KAS version fromgetServerInfo
gRPC response without patch.TBD: Hi reviewer, please me know if a fallback toGITLAB_KAS_VERSION
, or even the GitLab version, is preferred. I'll be happy to add them back if the robustness (against rpc issue) worth the little complexity.
- New logic in this MR: On top of the existing logic, try
getServerInfo
gRPC first.
MR acceptance checklist
Please evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.
Screenshots or screen recordings
Screenshots are required for UI changes, and strongly recommended for all other merge requests.
Before | After (same) | |
---|---|---|
Agent setup UI image.tag is unchanged
|
![]() |
![]() getServerInfo gRPC call under the hood. |
To confirm the --image.tag
actually comes from getServerInfo
, it's possible to run kas from soruce to test a wired version like 17.88.99
.
How to set up and validate locally
- Follow Run KAS from within GDK to enable KAS locally
- Check curernt KAS vbersion at
https://gdk.test:3443/api/v4/metadata
. - Visit
https://gdk.test:3443/gitlab-org/gitlab-test/-/clusters
- Click
Connect a cluster
- Input arbitrary agent name (e.g.
a1
) underOption 2: Create and register an agent with the UI
. ClickCreate and register
. - Confirm version after
--set image.tag=
matches the KAS version from step 2, but with patch being0
and without any postfix. - Delete/uninstall
a1
and recreate on with older version. Check that the "Agent version update required" warning feature still works.
Close #458891
Edited by Chou Yu Ta