Adds support to upload k8s ISO from local - #147
Conversation
| return &r, nil | ||
| } | ||
|
|
||
| type GetUploadParamsForKubernetesSupportedVersionResponse struct { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
merging this PR for the other changes. I'll raise a new issue here and on cloudstack to track the above
There was a problem hiding this comment.
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
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