ui,api: make description option for createKubernetesCluster (#7541)

Make the description for createKubernetesCLuster API optional. Similar to #7180

Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
This commit is contained in:
Abhishek Kumar 2023-05-25 15:22:58 +05:30 committed by GitHub
parent b0d7a20d5d
commit 8ff0071bec
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -39,6 +39,7 @@ import org.apache.cloudstack.api.response.ProjectResponse;
import org.apache.cloudstack.api.response.ServiceOfferingResponse;
import org.apache.cloudstack.api.response.ZoneResponse;
import org.apache.cloudstack.context.CallContext;
import org.apache.commons.lang3.StringUtils;
import org.apache.log4j.Logger;
import com.cloud.kubernetes.cluster.KubernetesCluster;
@ -68,7 +69,7 @@ public class CreateKubernetesClusterCmd extends BaseAsyncCreateCmd {
@Parameter(name = ApiConstants.NAME, type = CommandType.STRING, required = true, description = "name for the Kubernetes cluster")
private String name;
@Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, required = true, description = "description for the Kubernetes cluster")
@Parameter(name = ApiConstants.DESCRIPTION, type = CommandType.STRING, description = "description for the Kubernetes cluster")
private String description;
@ACL(accessType = AccessType.UseEntry)
@ -155,7 +156,7 @@ public class CreateKubernetesClusterCmd extends BaseAsyncCreateCmd {
}
public String getDisplayName() {
return description;
return StringUtils.firstNonEmpty(description, name);
}
public Long getDomainId() {

View File

@ -284,7 +284,6 @@ export default {
})
this.rules = reactive({
name: [{ required: true, message: this.$t('message.error.kubecluster.name') }],
description: [{ required: true, message: this.$t('message.error.cluster.description') }],
zoneid: [{ required: true, message: this.$t('message.error.zone.for.cluster') }],
kubernetesversionid: [{ required: true, message: this.$t('message.error.version.for.cluster') }],
serviceofferingid: [{ required: true, message: this.$t('message.error.serviceoffering.for.cluster') }],