Skip to content

Conversation

@vits-hugs
Copy link
Contributor

@vits-hugs vits-hugs commented May 13, 2025

Description

The URL used to register a kubernetes ISO is stored on the database, however it's not shown by the API listKubernetesSupportedVersion. This PR changes the API to return the kubernets ISO URL (isourl attribute) and the GUI to show it.

Types of changes

  • Breaking change (fix or feature that would cause existing functionality to change)
  • New feature (non-breaking change which adds functionality)
  • Bug fix (non-breaking change which fixes an issue)
  • Enhancement (improves an existing feature and functionality)
  • Cleanup (Code refactoring and cleanup, that may add test cases)
  • build/CI
  • test (unit or integration test code)

Feature/Enhancement Scale or Bug Severity

Feature/Enhancement Scale

  • Major
  • Minor

Screenshots (if appropriate):

Before modification:

image

After modification:
image

How Has This Been Tested?

I registered a kubernetes iso, and checked the API and GUI to see if the kubernetes ISO URL is appearing correctly.

@vits-hugs
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@vits-hugs a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10862 (QA-JID-621)

@DaanHoogland DaanHoogland requested review from Copilot and shwstppr May 14, 2025 05:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR enhances the Kubernetes ISO support by including the URL (isourl) in both the API response and the GUI display. Key changes include:

  • Adding the new attribute "isourl" to API response objects and updating its constant in ApiConstants.
  • Updating UI configuration and localization files to display the ISO URL.
  • Extending tests to verify that the ISO URL is returned only for admin users.

Reviewed Changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
ui/src/config/section/image.js Added "url" to the image details fields and adjusted the conditional logic for admin views and upload parameter conditions.
ui/public/locales/pt_BR.json Added the localized label for "isourl".
ui/public/locales/en.json Added the localized label for "isourl".
plugins/integrations/kubernetes-service/src/test/java/com/cloud/kubernetes/version/KubernetesVersionServiceTest.java Extended tests to cover scenarios for admin and non-admin users related to ISO URL.
plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/response/KubernetesSupportedVersionResponse.java Introduced a new field with getter and setter for the ISO URL.
plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/version/KubernetesVersionManagerImpl.java Updated response creation to include the ISO URL only for admin users.
api/src/main/java/org/apache/cloudstack/api/ApiConstants.java Defined the new constant for "isourl".
Comments suppressed due to low confidence (1)

ui/src/config/section/image.js:121

  • Verify that removing the isZoneCreated() condition is intentional here, as its absence might allow template uploads in zones that are not yet fully initialized.
show: () => { return 'getUploadParamsForTemplate' in store.getters.apis }

@codecov
Copy link

codecov bot commented May 14, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 16.18%. Comparing base (44119cf) to head (7ff3dca).
⚠️ Report is 1 commits behind head on 4.20.

Additional details and impacted files
@@            Coverage Diff            @@
##               4.20   #10862   +/-   ##
=========================================
  Coverage     16.18%   16.18%           
- Complexity    13300    13304    +4     
=========================================
  Files          5657     5657           
  Lines        498473   498483   +10     
  Branches      60495    60496    +1     
=========================================
+ Hits          80657    80676   +19     
+ Misses       408832   408825    -7     
+ Partials       8984     8982    -2     
Flag Coverage Δ
uitests 4.00% <ø> (ø)
unittests 17.03% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@apache apache deleted a comment from Copilot AI May 14, 2025
@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13383

@vits-hugs
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@vits-hugs a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✖️ el8 ✖️ el9 ✖️ debian ✖️ suse15. SL-JID 13385

@DaanHoogland
Copy link
Contributor

@vits-hugs , these are a bit awkward to search but here are the unit test failures: https://github.com/apache/cloudstack/actions/runs/15027619849/job/42263448047?pr=10862#step:7:14260

@vits-hugs
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@vits-hugs a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13404

Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While code looks fine, I'm not sure of design for checking if the KubernetesSupportedVersionResponse should have isoUrl.
Right now if the list API returns 10 versions it will query for root admin check 10 times.
@vits-hugs can we use ResponseView from the API class itself? This may require change in createKubernetesSupportedVersionResponse method. add/update API can always have ResponseView.Full while listAPI would need to check the caller and decide on Full/Restricted

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

@weizhouapache
Copy link
Member

While code looks fine, I'm not sure of design for checking if the KubernetesSupportedVersionResponse should have isoUrl. Right now if the list API returns 10 versions it will query for root admin check 10 times. @vits-hugs can we use ResponseView from the API class itself? This may require change in createKubernetesSupportedVersionResponse method. add/update API can always have ResponseView.Full while listAPI would need to check the caller and decide on Full/Restricted

+1

this PR could be optimised by adding isAdmin or isRootAdmin as the argument of the method, so that the following is run only once

        boolean isAdmin = accountManager.isRootAdmin(caller.getId());

@vits-hugs
Copy link
Contributor Author

@blueorangutan package

@blueorangutan
Copy link

@vits-hugs a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

Copy link
Member

@weizhouapache weizhouapache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

Not tested

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13425

@vits-hugs
Copy link
Contributor Author

@blueorangutan ui

@blueorangutan
Copy link

@vits-hugs a Jenkins job has been kicked to build UI QA env. I'll keep you posted as I make progress.

@vits-hugs
Copy link
Contributor Author

@weizhouapache could we run the tests here?

@blueorangutan
Copy link

UI build: ✔️
Live QA URL: https://qa.cloudstack.cloud/simulator/pr/10862 (QA-JID-634)

@DaanHoogland
Copy link
Contributor

@blueorangutan package

@blueorangutan
Copy link

@DaanHoogland a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 13591

@DaanHoogland
Copy link
Contributor

@blueorangutan test

@blueorangutan
Copy link

@DaanHoogland a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests

@blueorangutan
Copy link

[SF] Trillian test result (tid-13463)
Environment: kvm-ol8 (x2), Advanced Networking with Mgmt server ol8
Total time taken: 56078 seconds
Marvin logs: https://github.com/blueorangutan/acs-prs/releases/download/trillian/pr10862-t13463-kvm-ol8.zip
Smoke tests completed. 141 look OK, 0 have errors, 0 did not run
Only failed and skipped tests results shown below:

Test Result Time (s) Test File

@sureshanaparti sureshanaparti added this to the 4.20.2 milestone Jun 5, 2025
response.setSupportsAutoscaling(versionSupportsAutoscaling(kubernetesSupportedVersion));
updateTemplateDetailsInKubernetesSupportedVersionResponse(kubernetesSupportedVersion, response);
Account caller = CallContext.current().getCallingAccount();
boolean isRootAdmin = accountManager.isRootAdmin(caller.getId());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vits-hugs sorry if I'm not getting it but I think we are still checking isRootAdmin for each version

docHelp: 'adminguide/templates.html#uploading-templates-and-isos-from-a-local-computer',
listView: true,
popup: true,
show: () => { return isZoneCreated() && 'getUploadParamsForTemplate' in store.getters.apis },
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why this is reverted ?
@vits-hugs

@weizhouapache weizhouapache modified the milestones: 4.20.2, 4.20.3 Sep 10, 2025
@hsato03
Copy link
Collaborator

hsato03 commented Nov 28, 2025

@weizhouapache @shwstppr Thanks for the reviews, I have addressed them in the last commits. Could you take another look, please?

cc @DaanHoogland

@hsato03
Copy link
Collaborator

hsato03 commented Nov 28, 2025

@blueorangutan package

@blueorangutan
Copy link

@hsato03 a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress.

@blueorangutan
Copy link

Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 15862

@DaanHoogland DaanHoogland requested a review from shwstppr December 1, 2025 06:50
Copy link
Contributor

@shwstppr shwstppr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code lgtm

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.

7 participants