Skip to content

Commit 35e64ec

Browse files
authored
Merge branch 'main' into fix-typo-java
2 parents ba9c130 + 96ccd7e commit 35e64ec

File tree

80 files changed

+2663
-224
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+2663
-224
lines changed

.github/workflows/linter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# specific language governing permissions and limitations
1616
# under the License.
1717

18-
name: Lint
18+
name: pre-commit
1919

2020
on: [pull_request]
2121

.pre-commit-config.yaml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ repos:
4848
exclude: >
4949
(?x)
5050
^scripts/vm/systemvm/id_rsa\.cloud$|
51+
^server/src/test/java/org/apache/cloudstack/network/ssl/CertServiceTest.java$|
5152
^server/src/test/java/com/cloud/keystore/KeystoreTest\.java$|
5253
^server/src/test/resources/certs/dsa_self_signed\.key$|
5354
^server/src/test/resources/certs/non_root\.key$|
@@ -57,7 +58,8 @@ repos:
5758
^server/src/test/resources/certs/rsa_self_signed\.key$|
5859
^services/console-proxy/rdpconsole/src/test/doc/rdp-key\.pem$|
5960
^systemvm/agent/certs/localhost\.key$|
60-
^systemvm/agent/certs/realhostip\.key$
61+
^systemvm/agent/certs/realhostip\.key$|
62+
^test/integration/smoke/test_ssl_offloading.py$
6163
- id: end-of-file-fixer
6264
exclude: \.vhd$
6365
- id: fix-byte-order-marker
@@ -75,7 +77,7 @@ repos:
7577
name: run codespell
7678
description: Check spelling with codespell
7779
args: [--ignore-words=.github/linters/codespell.txt]
78-
exclude: ^systemvm/agent/noVNC/|^ui/package\.json$|^ui/package-lock\.json$|^ui/public/js/less\.min\.js$|^ui/public/locales/.*[^n].*\.json$
80+
exclude: ^systemvm/agent/noVNC/|^ui/package\.json$|^ui/package-lock\.json$|^ui/public/js/less\.min\.js$|^ui/public/locales/.*[^n].*\.json$|^server/src/test/java/org/apache/cloudstack/network/ssl/CertServiceTest.java$|^test/integration/smoke/test_ssl_offloading.py$
7981
- repo: https://github.com/pycqa/flake8
8082
rev: 7.0.0
8183
hooks:

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,14 @@
1-
# Apache CloudStack [![Build Status](https://github.com/apache/cloudstack/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/build.yml) [![UI Build](https://github.com/apache/cloudstack/actions/workflows/ui.yml/badge.svg)](https://github.com/apache/cloudstack/actions/workflows/ui.yml) [![License Check](https://github.com/apache/cloudstack/actions/workflows/rat.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/rat.yml) [![Simulator CI](https://github.com/apache/cloudstack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ci.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_cloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_cloudstack) [![codecov](https://codecov.io/gh/apache/cloudstack/branch/main/graph/badge.svg)](https://codecov.io/gh/apache/cloudstack)
1+
# Apache CloudStack
2+
3+
[![Build Status](https://github.com/apache/cloudstack/actions/workflows/build.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/build.yml)
4+
[![codecov](https://codecov.io/gh/apache/cloudstack/branch/main/graph/badge.svg)](https://codecov.io/gh/apache/cloudstack)
5+
[![Docker CloudStack Simulator Status](https://github.com/apache/cloudstack/actions/workflows/docker-cloudstack-simulator.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/docker-cloudstack-simulator.yml)
6+
[![License Check](https://github.com/apache/cloudstack/actions/workflows/rat.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/rat.yml)
7+
[![Linter Status](https://github.com/apache/cloudstack/actions/workflows/linter.yml/badge.svg)](https://github.com/apache/cloudstack/actions/workflows/linter.yml)
8+
[![Merge Conflict Checker Status](https://github.com/apache/cloudstack/actions/workflows/merge-conflict-checker.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/merge-conflict-checker.yml)
9+
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=apache_cloudstack&metric=alert_status)](https://sonarcloud.io/dashboard?id=apache_cloudstack)
10+
[![Simulator CI](https://github.com/apache/cloudstack/actions/workflows/ci.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ci.yml)
11+
[![UI Build](https://github.com/apache/cloudstack/actions/workflows/ui.yml/badge.svg?branch=main)](https://github.com/apache/cloudstack/actions/workflows/ui.yml)
212

313
[![Apache CloudStack](tools/logo/apache_cloudstack.png)](https://cloudstack.apache.org/)
414

api/src/main/java/com/cloud/agent/api/to/LoadBalancerTO.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public LoadBalancerTO(String uuid, String srcIp, int srcPort, String protocol, S
7171
this.destinations = new DestinationTO[destinations.size()];
7272
this.stickinessPolicies = null;
7373
this.sslCert = null;
74-
this.lbProtocol = null;
74+
this.lbProtocol = protocol;
7575
int i = 0;
7676
for (LbDestination destination : destinations) {
7777
this.destinations[i++] = new DestinationTO(destination.getIpAddress(), destination.getDestinationPortStart(), destination.isRevoked(), false);
@@ -205,6 +205,10 @@ public LbSslCert getSslCert() {
205205
return this.sslCert;
206206
}
207207

208+
public void setLbSslCert(LbSslCert sslCert) {
209+
this.sslCert = sslCert;
210+
}
211+
208212
public String getSrcIpVlan() {
209213
return srcIpVlan;
210214
}

api/src/main/java/com/cloud/hypervisor/Hypervisor.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,20 +31,22 @@
3131
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.DirectDownloadTemplate;
3232
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.RootDiskSizeOverride;
3333
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigration;
34+
import static com.cloud.hypervisor.Hypervisor.HypervisorType.Functionality.VmStorageMigrationWithSnapshots;
3435

3536
public class Hypervisor {
3637
public static class HypervisorType {
3738
public enum Functionality {
3839
DirectDownloadTemplate,
3940
RootDiskSizeOverride,
40-
VmStorageMigration
41+
VmStorageMigration,
42+
VmStorageMigrationWithSnapshots
4143
}
4244

4345
private static final Map<String, HypervisorType> hypervisorTypeMap = new LinkedHashMap<>();
4446
public static final HypervisorType None = new HypervisorType("None"); //for storage hosts
4547
public static final HypervisorType XenServer = new HypervisorType("XenServer", ImageFormat.VHD, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
4648
public static final HypervisorType KVM = new HypervisorType("KVM", ImageFormat.QCOW2, EnumSet.of(DirectDownloadTemplate, RootDiskSizeOverride, VmStorageMigration));
47-
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration));
49+
public static final HypervisorType VMware = new HypervisorType("VMware", ImageFormat.OVA, EnumSet.of(RootDiskSizeOverride, VmStorageMigration, VmStorageMigrationWithSnapshots));
4850
public static final HypervisorType Hyperv = new HypervisorType("Hyperv");
4951
public static final HypervisorType VirtualBox = new HypervisorType("VirtualBox");
5052
public static final HypervisorType Parralels = new HypervisorType("Parralels");

api/src/main/java/com/cloud/kubernetes/cluster/KubernetesCluster.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ enum State {
6060
Stopping("Resources for the Kubernetes cluster are being destroyed"),
6161
Stopped("All resources for the Kubernetes cluster are destroyed, Kubernetes cluster may still have ephemeral resource like persistent volumes provisioned"),
6262
Scaling("Transient state in which resources are either getting scaled up/down"),
63+
ScalingStoppedCluster("Transient state in which the service offerings of stopped clusters are getting scaled"),
6364
Upgrading("Transient state in which cluster is getting upgraded"),
6465
Importing("Transient state in which additional nodes are added as worker nodes to a cluster"),
6566
RemovingNodes("Transient state in which additional nodes are removed from a cluster"),
@@ -93,8 +94,11 @@ enum State {
9394
s_fsm.addTransition(State.Running, Event.AutoscaleRequested, State.Scaling);
9495
s_fsm.addTransition(State.Running, Event.ScaleUpRequested, State.Scaling);
9596
s_fsm.addTransition(State.Running, Event.ScaleDownRequested, State.Scaling);
97+
s_fsm.addTransition(State.Stopped, Event.ScaleUpRequested, State.ScalingStoppedCluster);
9698
s_fsm.addTransition(State.Scaling, Event.OperationSucceeded, State.Running);
9799
s_fsm.addTransition(State.Scaling, Event.OperationFailed, State.Alert);
100+
s_fsm.addTransition(State.ScalingStoppedCluster, Event.OperationSucceeded, State.Stopped);
101+
s_fsm.addTransition(State.ScalingStoppedCluster, Event.OperationFailed, State.Alert);
98102

99103
s_fsm.addTransition(State.Running, Event.UpgradeRequested, State.Upgrading);
100104
s_fsm.addTransition(State.Upgrading, Event.OperationSucceeded, State.Running);

api/src/main/java/com/cloud/network/lb/LoadBalancingRulesService.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ LoadBalancer createPublicLoadBalancerRule(String xId, String name, String descri
106106

107107
boolean applyLoadBalancerConfig(long lbRuleId) throws ResourceUnavailableException;
108108

109-
boolean assignCertToLoadBalancer(long lbRuleId, Long certId);
109+
boolean assignCertToLoadBalancer(long lbRuleId, Long certId, boolean isForced);
110110

111111
boolean removeCertFromLoadBalancer(long lbRuleId);
112112

api/src/main/java/com/cloud/vm/VmDetailConstants.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public interface VmDetailConstants {
4141
String KVM_VNC_PORT = "kvm.vnc.port";
4242
String KVM_VNC_ADDRESS = "kvm.vnc.address";
4343
String KVM_VNC_PASSWORD = "kvm.vnc.password";
44+
String KVM_GUEST_OS_MACHINE_TYPE = "kvm.guest.os.machine.type";
4445

4546
// KVM specific, custom virtual GPU hardware
4647
String VIDEO_HARDWARE = "video.hardware";

api/src/main/java/org/apache/cloudstack/api/command/admin/network/CreateNetworkOfferingCmd.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@
6161
import static com.cloud.network.Network.Service.UserData;
6262
import static com.cloud.network.Network.Service.Firewall;
6363

64+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNetrisNatted;
65+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNetrisRouted;
66+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNsxWithoutLb;
67+
6468
@APICommand(name = "createNetworkOffering", description = "Creates a network offering.", responseObject = NetworkOfferingResponse.class, since = "3.0.0",
6569
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
6670
public class CreateNetworkOfferingCmd extends BaseCmd {
@@ -297,7 +301,7 @@ public List<String> getSupportedServices() {
297301
SourceNat.getName(),
298302
PortForwarding.getName()));
299303
}
300-
if (getNsxSupportsLbService()) {
304+
if (getNsxSupportsLbService() || (provider != null && isNetrisNatted(getProvider(), getNetworkMode()))) {
301305
services.add(Lb.getName());
302306
}
303307
if (Boolean.TRUE.equals(forVpc)) {
@@ -410,7 +414,7 @@ private void getServiceProviderMapForExternalProvider(Map<String, List<String>>
410414
else if (NetworkOffering.NetworkMode.NATTED.name().equalsIgnoreCase(getNetworkMode()) || NetworkACL.getName().equalsIgnoreCase(service)) {
411415
serviceProviderMap.put(service, List.of(provider));
412416
}
413-
if (!getNsxSupportsLbService()) {
417+
if (isNsxWithoutLb(getProvider(), getNsxSupportsLbService()) || isNetrisRouted(getProvider(), getNetworkMode())) {
414418
serviceProviderMap.remove(Lb.getName());
415419
}
416420
}

api/src/main/java/org/apache/cloudstack/api/command/admin/vpc/CreateVPCOfferingCmd.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@
6262
import static com.cloud.network.Network.Service.UserData;
6363
import static com.cloud.network.Network.Service.Gateway;
6464

65+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNetrisNatted;
66+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNetrisRouted;
67+
import static org.apache.cloudstack.api.command.utils.OfferingUtils.isNsxWithoutLb;
68+
6569
@APICommand(name = "createVPCOffering", description = "Creates VPC offering", responseObject = VpcOfferingResponse.class,
6670
requestHasSensitiveInfo = false, responseHasSensitiveInfo = false)
6771
public class CreateVPCOfferingCmd extends BaseAsyncCreateCmd {
@@ -194,7 +198,7 @@ public List<String> getSupportedServices() {
194198
if (NetworkOffering.NetworkMode.ROUTED.name().equalsIgnoreCase(getNetworkMode())) {
195199
supportedServices.add(Gateway.getName());
196200
}
197-
if (getNsxSupportsLbService()) {
201+
if (getNsxSupportsLbService() || isNetrisNatted(getProvider(), getNetworkMode())) {
198202
supportedServices.add(Lb.getName());
199203
}
200204
}
@@ -259,7 +263,7 @@ else if (NetworkOffering.NetworkMode.NATTED.name().equalsIgnoreCase(getNetworkMo
259263
serviceProviderMap.put(service, List.of(provider));
260264
}
261265
}
262-
if (!getNsxSupportsLbService()) {
266+
if ((isNsxWithoutLb(getProvider(), getNsxSupportsLbService())) || isNetrisRouted(getProvider(), getNetworkMode())) {
263267
serviceProviderMap.remove(Lb.getName());
264268
}
265269
}

0 commit comments

Comments
 (0)