Skip to content

Adds url kubernetes iso #10862

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: 4.20
Choose a base branch
from
Open

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 shwstppr and Copilot May 14, 2025 05:56
Copy link

@Copilot 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 }

Copy link

codecov bot commented May 14, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 16.14%. Comparing base (f6d0590) to head (67225e2).
Report is 41 commits behind head on 4.20.

Additional details and impacted files
@@            Coverage Diff             @@
##               4.20   #10862    +/-   ##
==========================================
  Coverage     16.13%   16.14%            
- Complexity    13220    13241    +21     
==========================================
  Files          5651     5656     +5     
  Lines        496740   497530   +790     
  Branches      60183    60322   +139     
==========================================
+ Hits          80148    80309   +161     
- Misses       407674   408272   +598     
- Partials       8918     8949    +31     
Flag Coverage Δ
uitests 4.00% <ø> (-0.01%) ⬇️
unittests 16.99% <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

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.

5 participants