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 44 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

@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

@RosiKyu
Copy link
Collaborator

RosiKyu commented Jan 19, 2026

@blueorangutan package

@blueorangutan
Copy link

@RosiKyu 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 16427

Copy link
Collaborator

@RosiKyu RosiKyu left a comment

Choose a reason for hiding this comment

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

LGTM

Tested PR #10862 on CloudStack 4.20.3.0-SNAPSHOT with KVM hypervisor.

Test Summary

# Test Case Result
1 ISO URL visible to Root Admin via API (add & list) PASS
2 ISO URL hidden from Regular User via API PASS
3 ISO URL hidden from Domain Admin via API PASS
4 ISO URL persists after update operation PASS
5 UI displays ISO URL for Root Admin PASS
6 UI hides ISO URL for Regular User PASS

Detailed Test Report

Test Case 1: ISO URL visible to Root Admin via API

Objective: Verify root admin can see ISO URL in addKubernetesSupportedVersion and listKubernetesSupportedVersions API responses.

Environment:

  • CloudStack Management Server: r### Test Case 1: ISO URL visible to Root Admin via API **Objective**: Verify root admin can see ISO URL in addKubernetesSupportedVersionandlistKubernetesSupportedVersions` API responses.

Environment:

  • CloudStack Management Server: ref-trl-10656-k-Mol9-rositsa-kyuchukova-mgmt1
  • CloudStack Version: 4.20.3.0-SNAPSHOT
  • Zone: ref-trl-10656-k-Mol9-rositsa-kyuchukova
  • Account: admin (Root Admin)

Preconditions:

  • Kubernetes service enabled
  • Root admin account available

Test Steps:

  1. Add a new Kubernetes supported version with ISO URL
  2. List Kubernetes supported versions and verify isourl field is present

Expected Result: The isourl field should be visible in both add and list API responses for root admin.

Evidence:

  1. Add Kubernetes supported version:
(localcloud) 🐱 > add kubernetessupportedversion name=k8s-1.31 semanticversion=1.31.0 zoneid=57f4b0f4-8332-4cd4-b928-a813715c3ac0 url=http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso mincpunumber=2 minmemory=2048
{
  "kubernetessupportedversion": {
    "arch": "x86_64",
    "created": "2026-01-19T20:42:14+0000",
    "directdownload": false,
    "id": "f81365ca-e492-493d-835b-17e20a462876",
    "isoid": "e6e0b2e9-2635-4436-9b04-f675c160a717",
    "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
    "isostate": "Creating",
    "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
    "mincpunumber": 2,
    "minmemory": 2048,
    "name": "k8s-1.31",
    "semanticversion": "1.31.0",
    "state": "Enabled",
    "supportsautoscaling": true,
    "supportsha": true,
    "zoneid": "57f4b0f4-8332-4cd4-b928-a813715c3ac0",
    "zonename": "ref-trl-10656-k-Mol9-rositsa-kyuchukova"
  }
}
  1. List Kubernetes supported versions:
(localcloud) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly returned in both API responses for root admin.

Test Case 2: ISO URL hidden from Regular User via API

Objective: Verify non-admin users cannot see ISO URL in listKubernetesSupportedVersions API response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Regular user account ACSUser with API keys configured

Test Steps:

  1. Configure CloudMonkey profile with regular user API keys
  2. Verify user context (accounttype=0, rolename=User)
  3. List Kubernetes supported versions and verify isourl field is absent

Expected Result: The isourl field should NOT be present in the API response for regular users.

Evidence:

  1. Verify user context:
(userprofile) 🐱 > list accounts filter=id,name,accounttype,rolename
{
  "account": [
    {
      "accounttype": 0,
      "id": "3b5a74d3-b570-436b-9bf4-47201e2958da",
      "name": "ACSUser",
      "rolename": "User"
    }
  ],
  "count": 1
}
  1. List Kubernetes supported versions as regular user:
(userprofile) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly hidden from regular users. Only id, isoname, isostate, name, and semanticversion are returned.

Test Case 3: ISO URL hidden from Domain Admin via API

Objective: Verify domain admin users cannot see ISO URL in listKubernetesSupportedVersions API response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Domain Admin account created with API keys configured

Test Steps:

  1. Create Domain Admin account
  2. Configure CloudMonkey profile with Domain Admin API keys
  3. Verify user context (accounttype=2, rolename=Domain Admin)
  4. List Kubernetes supported versions and verify isourl field is absent

Expected Result: The isourl field should NOT be present in the API response for Domain Admin users.

Evidence:

  1. Create Domain Admin account:
(localcloud) 🐱 > create account username=domainadmin password=password [email protected] firstname=Domain lastname=Admin accounttype=2
{
  "account": {
    "accounttype": 2,
    "name": "domainadmin",
    "rolename": "Domain Admin",
    "roletype": "DomainAdmin",
    ...
  }
}
  1. Register API keys:
(localcloud) 🐱 > registerUserKeys id=0d9a9d46-a62f-426c-8205-461b4d38f7c3
{
  "userkeys": {
    "apikey": "sC15hB79yQcTpEY0qyejzqRSZ5KwQODWSrQr3UZ75gkIHUNtycoZTOo0aegk8NqrIen0GGEWSPEtRtUgNsGURg",
    "secretkey": "svlRUFANtOJVMO1ZfboqzaeV7agaXJx1ogqIvTZbo-J1UTjnGm8558rLNYGlHlDWhJ2ifOH7zAyNJ56Q43s6fA"
  }
}
  1. Verify Domain Admin context (409 APIs discovered):
(domainadminprofile) 🐱 > sync
Discovered 409 APIs
(domainadminprofile) 🐱 > list accounts filter=id,name,accounttype,rolename
{
  "account": [
    {
      "accounttype": 2,
      "id": "a41b9091-5272-4e7d-835c-d74508875256",
      "name": "domainadmin",
      "rolename": "Domain Admin"
    }
  ],
  "count": 1
}
  1. List Kubernetes supported versions as Domain Admin:
(domainadminprofile) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly hidden from Domain Admin users. Only Root Admin can view the ISO URL.

Test Case 4: Update Kubernetes version - ISO URL persists

Objective: Verify that updating a Kubernetes supported version preserves the ISO URL in the response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Root Admin account

Test Steps:

  1. Update Kubernetes supported version state to Disabled
  2. Verify isourl field is present in update response
  3. List Kubernetes supported versions and verify isourl persists

Expected Result: The isourl field should be present in both update response and subsequent list.

Evidence:

  1. Update Kubernetes version state:
(localcloud) 🐱 > update kubernetessupportedversion id=f81365ca-e492-493d-835b-17e20a462876 state=Disabled
{
  "kubernetessupportedversion": {
    "arch": "x86_64",
    "created": "2026-01-19T20:42:14+0000",
    "directdownload": false,
    "id": "f81365ca-e492-493d-835b-17e20a462876",
    "isoid": "e6e0b2e9-2635-4436-9b04-f675c160a717",
    "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
    "isostate": "Ready",
    "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
    "mincpunumber": 2,
    "minmemory": 2048,
    "name": "k8s-1.31",
    "semanticversion": "1.31.0",
    "state": "Disabled",
    "supportsautoscaling": true,
    "supportsha": true,
    "zoneid": "57f4b0f4-8332-4cd4-b928-a813715c3ac0",
    "zonename": "ref-trl-10656-k-Mol9-rositsa-kyuchukova"
  }
}
  1. List Kubernetes supported versions:
(localcloud) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,state,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0",
      "state": "Disabled"
    }
  ]
}

Test Result: PASS - The isourl field persists correctly after updating the Kubernetes supported version.

Test Case 5: UI displays ISO URL for Root Admin

Objective: Verify the CloudStack UI shows the ISO URL field in Kubernetes Supported Version details for Root Admin.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Root Admin account

Test Steps:

  1. Login to CloudStack UI as admin
  2. Navigate to ImagesKubernetes ISOs
  3. Click on k8s-1.31 to view details
  4. Verify ISO URL field is visible in the details panel

Expected Result: The ISO URL field should be visible in the UI for Root Admin users.

Evidence:

screencapture-10-0-33-142-8080-client-2026-01-19-23_00_15

The screenshot shows:

  • Logged in as admin cloud (Root Admin)
  • Kubernetes ISO details page for k8s-1.31
  • ISO URL field visible at bottom of details panel: http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso

Test Result: PASS - The ISO URL field is correctly displayed in the UI for Root Admin.

Test Case 6: UI hides ISO URL for Regular User

Objective: Verify the CloudStack UI does NOT show the ISO URL field in Kubernetes Supported Version details for regular users.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Regular user account ACSUser

Test Steps:

  1. Login to CloudStack UI as user (ACloudStack User)
  2. Navigate to ImagesKubernetes ISOs
  3. Click on k8s-1.31 to view details
  4. Verify ISO URL field is NOT visible in the details panel

Expected Result: The ISO URL field should NOT be visible in the UI for regular users.

Evidence:

screencapture-10-0-33-142-8080-client-2026-01-19-23_04_27

The screenshot shows:

  • Logged in as ACloudStack User (Regular User)
  • Kubernetes ISO details page for k8s-1.31
  • Details panel ends at Created field (19 Jan 2026 20:42:14)
  • ISO URL field is NOT present

Comparison with Root Admin view:

Field Root Admin Regular User
Name
Semantic version
ISO state
Created
ISO URL ✗ (hidden)

Test Result: PASS - The ISO URL field is correctly hidden in the UI for regular users.ef-trl-10656-k-Mol9-rositsa-kyuchukova-mgmt1`

  • CloudStack Version: 4.20.3.0-SNAPSHOT
  • Zone: ref-trl-10656-k-Mol9-rositsa-kyuchukova
  • Account: admin (Root Admin)

Preconditions:

  • Kubernetes service enabled
  • Root admin account available

Test Steps:

  1. Add a new Kubernetes supported version with ISO URL
  2. List Kubernetes supported versions and verify isourl field is present

Expected Result: The isourl field should be visible in both add and list API responses for root admin.

Evidence:

  1. Add Kubernetes supported version:
(localcloud) 🐱 > add kubernetessupportedversion name=k8s-1.31 semanticversion=1.31.0 zoneid=57f4b0f4-8332-4cd4-b928-a813715c3ac0 url=http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso mincpunumber=2 minmemory=2048
{
  "kubernetessupportedversion": {
    "arch": "x86_64",
    "created": "2026-01-19T20:42:14+0000",
    "directdownload": false,
    "id": "f81365ca-e492-493d-835b-17e20a462876",
    "isoid": "e6e0b2e9-2635-4436-9b04-f675c160a717",
    "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
    "isostate": "Creating",
    "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
    "mincpunumber": 2,
    "minmemory": 2048,
    "name": "k8s-1.31",
    "semanticversion": "1.31.0",
    "state": "Enabled",
    "supportsautoscaling": true,
    "supportsha": true,
    "zoneid": "57f4b0f4-8332-4cd4-b928-a813715c3ac0",
    "zonename": "ref-trl-10656-k-Mol9-rositsa-kyuchukova"
  }
}
  1. List Kubernetes supported versions:
(localcloud) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly returned in both API responses for root admin.

Test Case 2: ISO URL hidden from Regular User via API

Objective: Verify non-admin users cannot see ISO URL in listKubernetesSupportedVersions API response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Regular user account ACSUser with API keys configured

Test Steps:

  1. Configure CloudMonkey profile with regular user API keys
  2. Verify user context (accounttype=0, rolename=User)
  3. List Kubernetes supported versions and verify isourl field is absent

Expected Result: The isourl field should NOT be present in the API response for regular users.

Evidence:

  1. Verify user context:
(userprofile) 🐱 > list accounts filter=id,name,accounttype,rolename
{
  "account": [
    {
      "accounttype": 0,
      "id": "3b5a74d3-b570-436b-9bf4-47201e2958da",
      "name": "ACSUser",
      "rolename": "User"
    }
  ],
  "count": 1
}
  1. List Kubernetes supported versions as regular user:
(userprofile) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly hidden from regular users. Only id, isoname, isostate, name, and semanticversion are returned.

Test Case 3: ISO URL hidden from Domain Admin via API

Objective: Verify domain admin users cannot see ISO URL in listKubernetesSupportedVersions API response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Domain Admin account created with API keys configured

Test Steps:

  1. Create Domain Admin account
  2. Configure CloudMonkey profile with Domain Admin API keys
  3. Verify user context (accounttype=2, rolename=Domain Admin)
  4. List Kubernetes supported versions and verify isourl field is absent

Expected Result: The isourl field should NOT be present in the API response for Domain Admin users.

Evidence:

  1. Create Domain Admin account:
(localcloud) 🐱 > create account username=domainadmin password=password [email protected] firstname=Domain lastname=Admin accounttype=2
{
  "account": {
    "accounttype": 2,
    "name": "domainadmin",
    "rolename": "Domain Admin",
    "roletype": "DomainAdmin",
    ...
  }
}
  1. Register API keys:
(localcloud) 🐱 > registerUserKeys id=0d9a9d46-a62f-426c-8205-461b4d38f7c3
{
  "userkeys": {
    "apikey": "sC15hB79yQcTpEY0qyejzqRSZ5KwQODWSrQr3UZ75gkIHUNtycoZTOo0aegk8NqrIen0GGEWSPEtRtUgNsGURg",
    "secretkey": "svlRUFANtOJVMO1ZfboqzaeV7agaXJx1ogqIvTZbo-J1UTjnGm8558rLNYGlHlDWhJ2ifOH7zAyNJ56Q43s6fA"
  }
}
  1. Verify Domain Admin context (409 APIs discovered):
(domainadminprofile) 🐱 > sync
Discovered 409 APIs
(domainadminprofile) 🐱 > list accounts filter=id,name,accounttype,rolename
{
  "account": [
    {
      "accounttype": 2,
      "id": "a41b9091-5272-4e7d-835c-d74508875256",
      "name": "domainadmin",
      "rolename": "Domain Admin"
    }
  ],
  "count": 1
}
  1. List Kubernetes supported versions as Domain Admin:
(domainadminprofile) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,isoname,isostate,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
      "isostate": "Ready",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0"
    }
  ]
}

Test Result: PASS - The isourl field is correctly hidden from Domain Admin users. Only Root Admin can view the ISO URL.

Test Case 4: Update Kubernetes version - ISO URL persists

Objective: Verify that updating a Kubernetes supported version preserves the ISO URL in the response.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Root Admin account

Test Steps:

  1. Update Kubernetes supported version state to Disabled
  2. Verify isourl field is present in update response
  3. List Kubernetes supported versions and verify isourl persists

Expected Result: The isourl field should be present in both update response and subsequent list.

Evidence:

  1. Update Kubernetes version state:
(localcloud) 🐱 > update kubernetessupportedversion id=f81365ca-e492-493d-835b-17e20a462876 state=Disabled
{
  "kubernetessupportedversion": {
    "arch": "x86_64",
    "created": "2026-01-19T20:42:14+0000",
    "directdownload": false,
    "id": "f81365ca-e492-493d-835b-17e20a462876",
    "isoid": "e6e0b2e9-2635-4436-9b04-f675c160a717",
    "isoname": "k8s-1.31-Kubernetes-Binaries-ISO",
    "isostate": "Ready",
    "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
    "mincpunumber": 2,
    "minmemory": 2048,
    "name": "k8s-1.31",
    "semanticversion": "1.31.0",
    "state": "Disabled",
    "supportsautoscaling": true,
    "supportsha": true,
    "zoneid": "57f4b0f4-8332-4cd4-b928-a813715c3ac0",
    "zonename": "ref-trl-10656-k-Mol9-rositsa-kyuchukova"
  }
}
  1. List Kubernetes supported versions:
(localcloud) 🐱 > list kubernetessupportedversions filter=id,name,semanticversion,state,isourl
{
  "count": 1,
  "kubernetessupportedversion": [
    {
      "id": "f81365ca-e492-493d-835b-17e20a462876",
      "isourl": "http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso",
      "name": "k8s-1.31",
      "semanticversion": "1.31.0",
      "state": "Disabled"
    }
  ]
}

Test Result: PASS - The isourl field persists correctly after updating the Kubernetes supported version.

Test Case 5: UI displays ISO URL for Root Admin

Objective: Verify the CloudStack UI shows the ISO URL field in Kubernetes Supported Version details for Root Admin.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Root Admin account

Test Steps:

  1. Login to CloudStack UI as admin
  2. Navigate to ImagesKubernetes ISOs
  3. Click on k8s-1.31 to view details
  4. Verify ISO URL field is visible in the details panel

Expected Result: The ISO URL field should be visible in the UI for Root Admin users.

Evidence:

screencapture-10-0-33-142-8080-client-2026-01-19-23_00_15

The screenshot shows:

  • Logged in as admin cloud (Root Admin)
  • Kubernetes ISO details page for k8s-1.31
  • ISO URL field visible at bottom of details panel: http://10.0.3.122/kirantemplates/cks-1.31-calico-3.29.0.iso

Test Result: PASS - The ISO URL field is correctly displayed in the UI for Root Admin.

Test Case 6: UI hides ISO URL for Regular User

Objective: Verify the CloudStack UI does NOT show the ISO URL field in Kubernetes Supported Version details for regular users.

Preconditions:

  • Kubernetes supported version exists (created in Test Case 1)
  • Regular user account ACSUser

Test Steps:

  1. Login to CloudStack UI as user (ACloudStack User)
  2. Navigate to ImagesKubernetes ISOs
  3. Click on k8s-1.31 to view details
  4. Verify ISO URL field is NOT visible in the details panel

Expected Result: The ISO URL field should NOT be visible in the UI for regular users.

Evidence:

screencapture-10-0-33-142-8080-client-2026-01-19-23_04_27

The screenshot shows:

  • Logged in as ACloudStack User (Regular User)
  • Kubernetes ISO details page for k8s-1.31
  • Details panel ends at Created field (19 Jan 2026 20:42:14)
  • ISO URL field is NOT present

Comparison with Root Admin view:

Field Root Admin Regular User
Name
Semantic version
ISO state
Created
ISO URL ✗ (hidden)

Test Result: PASS - The ISO URL field is correctly hidden in the UI for regular users.

@DaanHoogland DaanHoogland merged commit 2a6ce0c into apache:4.20 Jan 20, 2026
26 checks passed
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.

8 participants