Skip to content

Adds support to upload k8s ISO from local - #147

Merged
abh1sar merged 3 commits into
support-4.22.1.0from
4.22.1-uploadK8sISO
Aug 5, 2026
Merged

Adds support to upload k8s ISO from local#147
abh1sar merged 3 commits into
support-4.22.1.0from
4.22.1-uploadK8sISO

Conversation

@Pearl1594

Copy link
Copy Markdown
Contributor

Adds support to upload k8s binaries / data ISO from local introduced with apache/cloudstack#9561 in 4.22.0 - enabling API in 4.22.1.0 SDK

@abh1sar abh1sar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Similar to #144 ,
"getUploadParamsForKubernetesSupportedVersion": "uploadParams"
should be added to
in generate.go -> nestedResponse

return &r, nil
}

type GetUploadParamsForKubernetesSupportedVersionResponse struct {

@abh1sar abh1sar Aug 4, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This looks like a bug in CloudStack.
The api says that it returns KubernetesSupportedVersionResponse.class

@APICommand(name = "getUploadParamsForKubernetesSupportedVersion",
        description = "Upload a supported Kubernetes version",
        responseObject = KubernetesSupportedVersionResponse.class,
        responseView = ResponseObject.ResponseView.Full,
        entityType = {KubernetesSupportedVersion.class},
        authorized = {RoleType.Admin})

But it actually returns GetUploadParamsResponse

GetUploadParamsResponse response = kubernetesVersionService.registerKubernetesSupportedVersionForPostUpload(this);
            if (response == null) {
                throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to add Kubernetes supported version");
            }
            response.setResponseName(getCommandName());
            setResponseObject(response);

how do you think we should handle it? @Pearl1594

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Then we let this remain open until we fix it upstream. Let's open an issue in the CloudStack repo and link it here to track it.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

merging this PR for the other changes. I'll raise a new issue here and on cloudstack to track the above

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

On further research I found that there are similar other APIs in cloudstack and the go-sdk handles some of these explicitly like the quotaBalance api

	if a.Name == "quotaBalance" {
		pn("type QuotaBalanceResponse struct {")
		pn("    Statement QuotaBalanceResponseType `json:\"balance\"`")
		pn("}")
		pn("")
		pn("type QuotaBalanceResponseType struct {")
		pn("    StartQuota float64  `json:\"startquota\"`")
		pn("    Credits    []string `json:\"credits\"`")
		pn("    StartDate  string   `json:\"startdate\"`")
		pn("    Currency   string   `json:\"currency\"`")
		pn("}")
		pn("")
		return
	}

I have added a similar change for getUploadParamsForKubernetesSupportedVersion, but I merged the commit directly into support-4.22.1.0 by mistake.
@Pearl1594 can you please check/review it: 33aaef3

@abh1sar
abh1sar marked this pull request as ready for review August 5, 2026 08:13

@abh1sar abh1sar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@abh1sar
abh1sar merged commit adae854 into support-4.22.1.0 Aug 5, 2026
1 check failed
@abh1sar
abh1sar deleted the 4.22.1-uploadK8sISO branch August 5, 2026 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants