Skip to content

Commit ddaa65f

Browse files
committed
Address review comments
1 parent 82e0bf5 commit ddaa65f

File tree

10 files changed

+30
-30
lines changed

10 files changed

+30
-30
lines changed

api/src/main/java/org/apache/cloudstack/api/command/user/userdata/DeleteCniConfigurationCmd.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
authorized = {RoleType.Admin, RoleType.ResourceAdmin, RoleType.DomainAdmin, RoleType.User})
3535
public class DeleteCniConfigurationCmd extends DeleteUserDataCmd {
3636

37-
public static final Logger logger = LogManager.getLogger(DeleteUserDataCmd.class.getName());
37+
public static final Logger logger = LogManager.getLogger(DeleteCniConfigurationCmd.class.getName());
3838

3939

4040
/////////////////////////////////////////////////////
@@ -49,7 +49,7 @@ public void execute() {
4949
response.setSuccess(result);
5050
setResponseObject(response);
5151
} else {
52-
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete userdata");
52+
throw new ServerApiException(ApiErrorCode.INTERNAL_ERROR, "Failed to delete CNI configuration");
5353
}
5454
}
5555

api/src/main/java/org/apache/cloudstack/api/response/TemplateResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ public class TemplateResponse extends BaseResponseWithTagInformation implements
210210

211211
@SerializedName(ApiConstants.FOR_CKS)
212212
@Param(description = "If true it indicates that the template can be used for CKS cluster deployments",
213-
since = "4.20")
213+
since = "4.21.0")
214214
private Boolean forCks;
215215

216216
@SerializedName(ApiConstants.DEPLOY_AS_IS_DETAILS)

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterManagerImpl.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -805,8 +805,6 @@ public KubernetesClusterResponse createKubernetesClusterResponse(long kubernetes
805805
response.setClusterType(kubernetesCluster.getClusterType());
806806
response.setCreated(kubernetesCluster.getCreated());
807807

808-
809-
810808
return response;
811809
}
812810

@@ -2476,6 +2474,7 @@ public ConfigKey<?>[] getConfigKeys() {
24762474
KubernetesClusterUpgradeTimeout,
24772475
KubernetesClusterUpgradeRetries,
24782476
KubernetesClusterAddNodeTimeout,
2477+
KubernetesClusterRemoveNodeTimeout,
24792478
KubernetesClusterExperimentalFeaturesEnabled,
24802479
KubernetesMaxClusterSize,
24812480
KubernetesControlNodeInstallAttemptWait,

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/KubernetesClusterService.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ public interface KubernetesClusterService extends PluggableService, Configurable
8888
static final ConfigKey<Long> KubernetesClusterAddNodeTimeout = new ConfigKey<Long>("Advanced", Long.class,
8989
"cloud.kubernetes.cluster.add.node.timeout",
9090
"3600",
91-
"Timeout interval (in seconds) in which an external node(VM / baremetal host) addition to a cluster should be completed",
91+
"Timeout interval (in seconds) in which an external node (VM / baremetal host) addition to a cluster should be completed",
9292
true,
9393
KubernetesServiceEnabled.key());
9494
static final ConfigKey<Long> KubernetesClusterRemoveNodeTimeout = new ConfigKey<Long>("Advanced", Long.class,
95-
"cloud.kubernetes.cluster.add.node.timeout",
95+
"cloud.kubernetes.cluster.remove.node.timeout",
9696
"900",
97-
"Timeout interval (in seconds) in which an external node(VM / baremetal host) removal from a cluster should be completed",
97+
"Timeout interval (in seconds) in which an external node (VM / baremetal host) removal from a cluster should be completed",
9898
true,
9999
KubernetesServiceEnabled.key());
100100
static final ConfigKey<Boolean> KubernetesClusterExperimentalFeaturesEnabled = new ConfigKey<Boolean>("Advanced", Boolean.class,
@@ -113,25 +113,25 @@ public interface KubernetesClusterService extends PluggableService, Configurable
113113
static final ConfigKey<Long> KubernetesControlNodeInstallAttemptWait = new ConfigKey<Long>("Advanced", Long.class,
114114
"cloud.kubernetes.control.node.install.attempt.wait.duration",
115115
"15",
116-
"Time in seconds for the installation process to wait before it re-attempts",
116+
"Control Nodes: Time in seconds for the installation process to wait before it re-attempts",
117117
true,
118118
KubernetesServiceEnabled.key());
119119
static final ConfigKey<Long> KubernetesControlNodeInstallReattempts = new ConfigKey<Long>("Advanced", Long.class,
120120
"cloud.kubernetes.control.node.install.reattempt.count",
121121
"100",
122-
"Number of times the offline installation of K8S will be re-attempted",
122+
"Control Nodes: Number of times the offline installation of K8S will be re-attempted",
123123
true,
124124
KubernetesServiceEnabled.key());
125125
final ConfigKey<Long> KubernetesWorkerNodeInstallAttemptWait = new ConfigKey<Long>("Advanced", Long.class,
126126
"cloud.kubernetes.worker.node.install.attempt.wait.duration",
127127
"30",
128-
"Time in seconds for the installation process to wait before it re-attempts",
128+
"Worker Nodes: Time in seconds for the installation process to wait before it re-attempts",
129129
true,
130130
KubernetesServiceEnabled.key());
131131
static final ConfigKey<Long> KubernetesWorkerNodeInstallReattempts = new ConfigKey<Long>("Advanced", Long.class,
132132
"cloud.kubernetes.worker.node.install.reattempt.count",
133133
"40",
134-
"Number of times the offline installation of K8S will be re-attempted",
134+
"Worker Nodes: Number of times the offline installation of K8S will be re-attempted",
135135
true,
136136
KubernetesServiceEnabled.key());
137137
static final ConfigKey<Integer> KubernetesEtcdNodeStartPort = new ConfigKey<Integer>("Advanced", Integer.class,

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/cluster/actionworkers/KubernetesClusterStartWorker.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -334,10 +334,10 @@ private String getKubernetesAdditionalControlNodeConfig(final String joinIp, fin
334334
}
335335

336336
private String getInitialEtcdClusterDetails(List<String> ipAddresses, List<String> hostnames) {
337-
String initialCluster = "%s=http://%s:2380";
337+
String initialCluster = "%s=http://%s:%s";
338338
StringBuilder clusterInfo = new StringBuilder();
339339
for (int i = 0; i < ipAddresses.size(); i++) {
340-
clusterInfo.append(String.format(initialCluster, hostnames.get(i), ipAddresses.get(i)));
340+
clusterInfo.append(String.format(initialCluster, hostnames.get(i), ipAddresses.get(i), KubernetesClusterActionWorker.ETCD_NODE_PEER_COMM_PORT));
341341
if (i < ipAddresses.size()-1) {
342342
clusterInfo.append(",");
343343
}
@@ -353,7 +353,7 @@ private String getInitialEtcdClusterDetails(List<String> ipAddresses, List<Strin
353353
private String getEtcdEndpointList(List<Network.IpAddresses> ipAddresses) {
354354
StringBuilder endpoints = new StringBuilder();
355355
for (int i = 0; i < ipAddresses.size(); i++) {
356-
endpoints.append(String.format("- http://%s:2379", ipAddresses.get(i).getIp4Address()));
356+
endpoints.append(String.format("- http://%s:%s", ipAddresses.get(i).getIp4Address(), KubernetesClusterActionWorker.ETCD_NODE_CLIENT_REQUEST_PORT));
357357
if (i < ipAddresses.size()-1) {
358358
endpoints.append("\n ");
359359
}

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/AddNodesToKubernetesClusterCmd.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,7 @@ public class AddNodesToKubernetesClusterCmd extends BaseAsyncCmd {
5252
entityType= UserVmResponse.class,
5353
description = "comma separated list of (external) node (physical or virtual machines) IDs that need to be" +
5454
"added as worker nodes to an existing managed Kubernetes cluster (CKS)",
55-
required = true,
56-
since = "4.21.0")
55+
required = true)
5756
private List<Long> nodeIds;
5857

5958
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, required = true,
@@ -62,13 +61,11 @@ public class AddNodesToKubernetesClusterCmd extends BaseAsyncCmd {
6261
private Long clusterId;
6362

6463
@Parameter(name = ApiConstants.MOUNT_CKS_ISO_ON_VR, type = CommandType.BOOLEAN,
65-
description = "(optional) Vmware only, uses the CKS cluster network VR to mount the CKS ISO",
66-
since = "4.21.0")
64+
description = "(optional) Vmware only, uses the CKS cluster network VR to mount the CKS ISO")
6765
private Boolean mountCksIsoOnVr;
6866

6967
@Parameter(name = ApiConstants.MANUAL_UPGRADE, type = CommandType.BOOLEAN,
70-
description = "(optional) indicates if the node is marked for manual upgrade and excluded from the Kubernetes cluster upgrade operation",
71-
since = "4.21.0")
68+
description = "(optional) indicates if the node is marked for manual upgrade and excluded from the Kubernetes cluster upgrade operation")
7269
private Boolean manualUpgrade;
7370

7471
/////////////////////////////////////////////////////

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/CreateKubernetesClusterCmd.java

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,18 +115,21 @@ public class CreateKubernetesClusterCmd extends BaseAsyncCreateCmd {
115115

116116
@ACL(accessType = AccessType.UseEntry)
117117
@Parameter(name = ApiConstants.NODE_TYPE_OFFERING_MAP, type = CommandType.MAP,
118-
description = "(Optional) Node Type to Service Offering ID mapping. If provided, it overrides the serviceofferingid parameter")
118+
description = "(Optional) Node Type to Service Offering ID mapping. If provided, it overrides the serviceofferingid parameter",
119+
since = "4.21.0")
119120
private Map<String, Map<String, String>> serviceOfferingNodeTypeMap;
120121

121122
@ACL(accessType = AccessType.UseEntry)
122123
@Parameter(name = ApiConstants.NODE_TYPE_TEMPLATE_MAP, type = CommandType.MAP,
123-
description = "(Optional) Node Type to Template ID mapping. If provided, it overrides the default template: System VM template")
124+
description = "(Optional) Node Type to Template ID mapping. If provided, it overrides the default template: System VM template",
125+
since = "4.21.0")
124126
private Map<String, Map<String, String>> templateNodeTypeMap;
125127

126128
@ACL(accessType = AccessType.UseEntry)
127129
@Parameter(name = ApiConstants.ETCD_NODES, type = CommandType.LONG,
128130
description = "(Optional) Number of Kubernetes cluster etcd nodes, default is 0." +
129-
"In case the number is greater than 0, etcd nodes are separate from master nodes and are provisioned accordingly")
131+
"In case the number is greater than 0, etcd nodes are separate from master nodes and are provisioned accordingly",
132+
since = "4.21.0")
130133
private Long etcdNodes;
131134

132135
@ACL(accessType = AccessType.UseEntry)
@@ -200,7 +203,8 @@ public class CreateKubernetesClusterCmd extends BaseAsyncCreateCmd {
200203
@Parameter(name = ApiConstants.CNI_CONFIG_DETAILS, type = CommandType.MAP,
201204
description = "used to specify the parameters values for the variables in userdata. " +
202205
"Example: cniconfigdetails[0].key=accesskey&cniconfigdetails[0].value=s389ddssaa&" +
203-
"cniconfigdetails[1].key=secretkey&cniconfigdetails[1].value=8dshfsss", since = "4.21.0")
206+
"cniconfigdetails[1].key=secretkey&cniconfigdetails[1].value=8dshfsss",
207+
since = "4.21.0")
204208
private Map cniConfigDetails;
205209

206210
@Parameter(name=ApiConstants.AS_NUMBER, type=CommandType.LONG, description="the AS Number of the network")

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/RemoveNodesFromKubernetesClusterCmd.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,12 @@ public class RemoveNodesFromKubernetesClusterCmd extends BaseAsyncCmd {
5858
entityType= UserVmResponse.class,
5959
description = "comma separated list of node (physical or virtual machines) IDs that need to be" +
6060
"removed from the Kubernetes cluster (CKS)",
61-
required = true,
62-
since = "4.21.0")
61+
required = true)
6362
private List<Long> nodeIds;
6463

6564
@Parameter(name = ApiConstants.ID, type = CommandType.UUID, required = true,
6665
entityType = KubernetesClusterResponse.class,
67-
description = "the ID of the Kubernetes cluster", since = "4.21.0")
66+
description = "the ID of the Kubernetes cluster")
6867
private Long clusterId;
6968

7069
/////////////////////////////////////////////////////

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/command/user/kubernetes/cluster/ScaleKubernetesClusterCmd.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ public class ScaleKubernetesClusterCmd extends BaseAsyncCmd {
7474

7575
@ACL(accessType = SecurityChecker.AccessType.UseEntry)
7676
@Parameter(name = ApiConstants.NODE_TYPE_OFFERING_MAP, type = CommandType.MAP,
77-
description = "(Optional) Node Type to Service Offering ID mapping. If provided, it overrides the serviceofferingid parameter")
77+
description = "(Optional) Node Type to Service Offering ID mapping. If provided, it overrides the serviceofferingid parameter",
78+
since = "4.21.0")
7879
protected Map<String, Map<String, String>> serviceOfferingNodeTypeMap;
7980

8081
@Parameter(name=ApiConstants.SIZE, type = CommandType.LONG,

server/src/main/java/com/cloud/api/ApiResponseHelper.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5417,7 +5417,7 @@ public ASNumberResponse createASNumberResponse(ASNumber asn) {
54175417
String rangeText = String.format("%s-%s", range.getStartASNumber(), range.getEndASNumber());
54185418
response.setAsNumberRange(rangeText);
54195419
} else {
5420-
logger.info("is null for as number: "+ asn.getAsNumber());
5420+
logger.info("Range is null for AS number: "+ asn.getAsNumber());
54215421
}
54225422
response.setAllocated(asn.getAllocatedTime());
54235423
response.setAllocationState(asn.isAllocated() ? "Allocated" : "Free");

0 commit comments

Comments
 (0)