Skip to content

Commit 4bdf35b

Browse files
committed
Merge remote-tracking branch 'apache/4.18'
2 parents 1031c31 + a11fc43 commit 4bdf35b

File tree

10 files changed

+55
-12
lines changed

10 files changed

+55
-12
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -166,11 +166,11 @@ public class UserVmResponse extends BaseResponseWithTagInformation implements Co
166166
private String serviceOfferingName;
167167

168168
@SerializedName(ApiConstants.DISK_OFFERING_ID)
169-
@Param(description = "the ID of the disk offering of the virtual machine", since = "4.4")
169+
@Param(description = "the ID of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
170170
private String diskOfferingId;
171171

172172
@SerializedName("diskofferingname")
173-
@Param(description = "the name of the disk offering of the virtual machine", since = "4.4")
173+
@Param(description = "the name of the disk offering of the virtual machine. This parameter should not be used for retrieving disk offering details of DATA volumes. Use listVolumes API instead", since = "4.4")
174174
private String diskOfferingName;
175175

176176
@SerializedName(ApiConstants.BACKUP_OFFERING_ID)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ private void upgradeKubernetesClusterNodes() {
9191
}
9292
try {
9393
result = SshHelper.sshExecute(publicIpAddress, sshPort, getControlNodeLoginUser(), sshKeyFile, null,
94-
String.format("sudo /opt/bin/kubectl drain %s --ignore-daemonsets --delete-local-data", hostName),
94+
String.format("sudo /opt/bin/kubectl drain %s --ignore-daemonsets --delete-emptydir-data", hostName),
9595
10000, 10000, 60000);
9696
} catch (Exception e) {
9797
logTransitStateDetachIsoAndThrow(Level.ERROR, String.format("Failed to upgrade Kubernetes cluster : %s, unable to drain Kubernetes node on VM : %s", kubernetesCluster.getName(), vm.getDisplayName()), kubernetesCluster, clusterVMs, KubernetesCluster.Event.OperationFailed, e);

plugins/integrations/kubernetes-service/src/main/resources/script/upgrade-kubernetes.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if [ -d "$BINARIES_DIR" ]; then
137137

138138
systemctl stop kubelet
139139
cp -a ${BINARIES_DIR}/k8s/{kubelet,kubectl} /opt/bin
140-
chmod +x {kubelet,kubectl}
140+
chmod +x /opt/bin/{kubelet,kubectl}
141141

142142
systemctl daemon-reload
143143
systemctl restart containerd

server/src/main/java/com/cloud/api/query/dao/UserVmJoinDaoImpl.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828

2929
import javax.inject.Inject;
3030

31-
import com.cloud.vm.VirtualMachine;
3231
import org.apache.cloudstack.affinity.AffinityGroupResponse;
3332
import org.apache.cloudstack.annotation.AnnotationService;
3433
import org.apache.cloudstack.annotation.dao.AnnotationDao;
@@ -45,6 +44,7 @@
4544
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
4645
import org.apache.cloudstack.query.QueryService;
4746
import org.apache.commons.lang3.BooleanUtils;
47+
import org.apache.commons.lang3.StringUtils;
4848
import org.apache.log4j.Logger;
4949
import org.springframework.stereotype.Component;
5050

@@ -62,6 +62,7 @@
6262
import com.cloud.storage.Storage.TemplateType;
6363
import com.cloud.storage.VnfTemplateDetailVO;
6464
import com.cloud.storage.VnfTemplateNicVO;
65+
import com.cloud.storage.Volume;
6566
import com.cloud.storage.dao.VnfTemplateDetailsDao;
6667
import com.cloud.storage.dao.VnfTemplateNicDao;
6768
import com.cloud.user.Account;
@@ -77,6 +78,7 @@
7778
import com.cloud.utils.net.Dhcp;
7879
import com.cloud.vm.UserVmDetailVO;
7980
import com.cloud.vm.UserVmManager;
81+
import com.cloud.vm.VirtualMachine;
8082
import com.cloud.vm.VirtualMachine.State;
8183
import com.cloud.vm.VmStats;
8284
import com.cloud.vm.dao.NicExtraDhcpOptionDao;
@@ -591,6 +593,11 @@ public UserVmResponse setUserVmResponse(ResponseView view, UserVmResponse userVm
591593
userVmData.addAffinityGroup(resp);
592594
}
593595

596+
if (StringUtils.isEmpty(userVmData.getDiskOfferingId()) && !Volume.Type.ROOT.equals(uvo.getVolumeType())) {
597+
userVmData.setDiskOfferingId(uvo.getDiskOfferingUuid());
598+
userVmData.setDiskOfferingName(uvo.getDiskOfferingName());
599+
}
600+
594601
return userVmData;
595602
}
596603

test/integration/smoke/test_kubernetes_clusters.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,7 @@ def test_06_delete_kubernetes_cluster(self):
531531
@attr(tags=["advanced", "smoke"], required_hardware="true")
532532
@skipTestIf("hypervisorNotSupported")
533533
def test_07_deploy_kubernetes_ha_cluster(self):
534-
"""Test to deploy a new Kubernetes cluster
534+
"""Test to deploy a new HA Kubernetes cluster
535535
536536
# Validate the following:
537537
# 1. createKubernetesCluster should return valid info for new cluster
@@ -542,14 +542,14 @@ def test_07_deploy_kubernetes_ha_cluster(self):
542542
if self.default_network:
543543
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
544544
global k8s_cluster
545-
k8s_cluster = self.getValidKubernetesCluster(1, 2)
545+
k8s_cluster = self.getValidKubernetesCluster(1, 3)
546546
self.debug("HA Kubernetes cluster with ID: %s successfully deployed" % k8s_cluster.id)
547547
return
548548

549549
@attr(tags=["advanced", "smoke"], required_hardware="true")
550550
@skipTestIf("hypervisorNotSupported")
551551
def test_08_upgrade_kubernetes_ha_cluster(self):
552-
"""Test to upgrade a Kubernetes cluster to newer version
552+
"""Test to upgrade a HA Kubernetes cluster to newer version
553553
554554
# Validate the following:
555555
# 1. upgradeKubernetesCluster should return valid info for the cluster
@@ -559,7 +559,7 @@ def test_08_upgrade_kubernetes_ha_cluster(self):
559559
if self.default_network:
560560
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
561561
global k8s_cluster
562-
k8s_cluster = self.getValidKubernetesCluster(1, 2, version=self.kubernetes_version_v1)
562+
k8s_cluster = self.getValidKubernetesCluster(1, 3, version=self.kubernetes_version_v1)
563563
time.sleep(self.services["sleep"])
564564

565565
self.debug("Upgrading HA Kubernetes cluster with ID: %s" % k8s_cluster.id)
@@ -586,7 +586,7 @@ def test_09_delete_kubernetes_ha_cluster(self):
586586
if self.default_network:
587587
self.skipTest("HA cluster on shared network requires external ip address, skipping it")
588588
global k8s_cluster
589-
k8s_cluster = self.getValidKubernetesCluster(1, 2)
589+
k8s_cluster = self.getValidKubernetesCluster(1, 3)
590590

591591
self.debug("Deleting Kubernetes cluster with ID: %s" % k8s_cluster.id)
592592
return

ui/public/locales/en.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,7 @@
422422
"label.cancel": "Cancel",
423423
"label.cancel.shutdown": "Cancel Shutdown",
424424
"label.cancelmaintenance": "Cancel maintenance",
425+
"label.cancel.host.as.degraded": "Cancel host as degraded",
425426
"label.capacity": "Capacity",
426427
"label.capacitybytes": "Capacity bytes",
427428
"label.capacityiops": "IOPS total",
@@ -597,6 +598,7 @@
597598
"label.db.usage.metrics": "DB/Usage server",
598599
"label.dbislocal": "The db runs locally",
599600
"label.dc.name": "DC name",
601+
"label.declare.host.as.degraded": "Declare host as degraded",
600602
"label.decline.invitation": "Decline invitation",
601603
"label.dedicate": "Dedicate",
602604
"label.dedicate.cluster": "Dedicate cluster",

ui/src/config/section/infra/hosts.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -295,6 +295,26 @@ export default {
295295
}
296296
}
297297
},
298+
{
299+
api: 'declareHostAsDegraded',
300+
icon: 'exception-outlined',
301+
label: 'label.declare.host.as.degraded',
302+
message: 'label.declare.host.as.degraded',
303+
dataView: true,
304+
show: (record) => {
305+
return record.resourcestate !== 'Degraded' && (record.state === 'Alert' || record.state === 'Disconnected')
306+
}
307+
},
308+
{
309+
api: 'cancelHostAsDegraded',
310+
icon: 'file-done-outlined',
311+
label: 'label.cancel.host.as.degraded',
312+
message: 'label.cancel.host.as.degraded',
313+
dataView: true,
314+
show: (record) => {
315+
return record.resourcestate === 'Degraded'
316+
}
317+
},
298318
{
299319
api: 'deleteHost',
300320
icon: 'delete-outlined',

ui/src/core/lazy_lib/icons_use.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,12 @@ import {
7373
DragOutlined,
7474
EditOutlined,
7575
EnvironmentOutlined,
76+
ExceptionOutlined,
7677
ExclamationCircleOutlined,
7778
EyeInvisibleOutlined,
7879
EyeOutlined,
7980
FieldTimeOutlined,
81+
FileDoneOutlined,
8082
FileProtectOutlined,
8183
FilterOutlined,
8284
FilterTwoTone,
@@ -230,10 +232,12 @@ export default {
230232
app.component('DragOutlined', DragOutlined)
231233
app.component('EditOutlined', EditOutlined)
232234
app.component('EnvironmentOutlined', EnvironmentOutlined)
235+
app.component('ExceptionOutlined', ExceptionOutlined)
233236
app.component('ExclamationCircleOutlined', ExclamationCircleOutlined)
234237
app.component('EyeInvisibleOutlined', EyeInvisibleOutlined)
235238
app.component('EyeOutlined', EyeOutlined)
236239
app.component('FieldTimeOutlined', FieldTimeOutlined)
240+
app.component('FileDoneOutlined', FileDoneOutlined)
237241
app.component('FileProtectOutlined', FileProtectOutlined)
238242
app.component('FilterOutlined', FilterOutlined)
239243
app.component('FilterTwoTone', FilterTwoTone)

ui/src/views/compute/CreateKubernetesCluster.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ export default {
278278
initForm () {
279279
this.formRef = ref()
280280
this.form = reactive({
281-
controlnodes: 2,
281+
controlnodes: 3,
282282
size: 1,
283283
noderootdisksize: 8
284284
})

ui/src/views/network/AclListRulesTab.vue

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,17 @@ export default {
333333
result += columnDelimiter
334334
}
335335
336-
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
336+
if (key === 'tags') {
337+
var tags = '"'
338+
if (item[key].length > 0) {
339+
item[key].forEach(tag => {
340+
tags += '(' + tag.key + ',' + tag.value + ')'
341+
})
342+
}
343+
result += tags + '"'
344+
} else {
345+
result += typeof item[key] === 'string' && item[key].includes(columnDelimiter) ? `"${item[key]}"` : item[key]
346+
}
337347
ctr++
338348
})
339349
result += lineDelimiter

0 commit comments

Comments
 (0)