Skip to content

Prefer getServerInfo gRPC for KAS version used on for Register Agent UI

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 from getServerInfo gRPC response without patch.
    • TBD: Hi reviewer, please me know if a fallback to GITLAB_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 before Sourced from Gitlab version under the hood. install_version_info Sourced from 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.

Screenshots

run kas from source as 17.88.99

install_version_17-88-00

How to set up and validate locally

  1. Follow Run KAS from within GDK to enable KAS locally
  2. Check curernt KAS vbersion at https://gdk.test:3443/api/v4/metadata.
    metadata_api
  3. Visit https://gdk.test:3443/gitlab-org/gitlab-test/-/clusters
  4. Click Connect a cluster
    image
  5. Input arbitrary agent name (e.g. a1) under Option 2: Create and register an agent with the UI. Click Create and register.
    image
  6. Confirm version after --set image.tag= matches the KAS version from step 2, but with patch being 0 and without any postfix.
    image
  7. Delete/uninstall a1 and recreate on with older version. Check that the "Agent version update required" warning feature still works.
    image

Close #458891

Edited by Chou Yu Ta

Merge request reports

Loading