Skip to content

Commit

Permalink
Merge branch '4.19'
Browse files Browse the repository at this point in the history
  • Loading branch information
vishesh92 committed Sep 24, 2024
2 parents a303c7c + 2398b5c commit 21d107c
Show file tree
Hide file tree
Showing 26 changed files with 349 additions and 72 deletions.
4 changes: 2 additions & 2 deletions api/src/main/java/com/cloud/network/NetworkModel.java
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public interface NetworkModel {

boolean areServicesSupportedByNetworkOffering(long networkOfferingId, Service... services);

Network getNetworkWithSGWithFreeIPs(Long zoneId);
Network getNetworkWithSGWithFreeIPs(Account account, Long zoneId);

Network getNetworkWithSecurityGroupEnabled(Long zoneId);

Expand Down Expand Up @@ -360,6 +360,6 @@ List<String[]> generateVmData(String userData, String userDataDetails, String se

boolean isSecurityGroupSupportedForZone(Long zoneId);

boolean checkSecurityGroupSupportForNetwork(DataCenter zone, List<Long> networkIds,
boolean checkSecurityGroupSupportForNetwork(Account account, DataCenter zone, List<Long> networkIds,
List<Long> securityGroupsIds);
}
21 changes: 5 additions & 16 deletions client/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,7 @@
<artifactId>cloudstack</artifactId>
<version>4.20.0.0-SNAPSHOT</version>
</parent>
<repositories>
<repository>
<id>juniper-tungsten-api</id>
<url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.juniper.tungsten</groupId>
<artifactId>juniper-tungsten-api</artifactId>
<version>2.0</version>
</dependency>
<dependency>
<groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId>
Expand Down Expand Up @@ -282,11 +271,6 @@
<artifactId>cloud-plugin-network-ovs</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-tungsten</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-elb</artifactId>
Expand Down Expand Up @@ -1113,6 +1097,11 @@
<artifactId>cloud-plugin-network-nsx</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-tungsten</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-api-vmware-sioc</artifactId>
Expand Down
5 changes: 0 additions & 5 deletions plugins/hypervisors/kvm/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -83,11 +83,6 @@
<version>${project.version}</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>org.apache.cloudstack</groupId>
<artifactId>cloud-plugin-network-tungsten</artifactId>
<version>${project.version}</version>
</dependency>
</dependencies>
<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.network.tungsten.agent.api;

import com.cloud.agent.api.Command;

import java.util.Objects;

public class SetupTfRouteCommand extends Command {
private final String privateIp;
private final String publicIp;
private final String srcNetwork;

public SetupTfRouteCommand(final String privateIp, final String publicIp, final String srcNetwork) {
this.privateIp = privateIp;
this.publicIp = publicIp;
this.srcNetwork = srcNetwork;
}

public String getPrivateIp() {
return privateIp;
}

public String getPublicIp() {
return publicIp;
}

public String getSrcNetwork() {
return srcNetwork;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
SetupTfRouteCommand that = (SetupTfRouteCommand) o;
return Objects.equals(privateIp, that.privateIp) && Objects.equals(publicIp, that.publicIp) && Objects.equals(srcNetwork, that.srcNetwork);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), privateIp, publicIp, srcNetwork);
}

@Override
public boolean executeInSequence() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.network.tungsten.agent.api;

import com.cloud.agent.api.Command;

import java.util.Objects;

public class SetupTungstenVRouterCommand extends Command {
private final String oper;
private final String inf;
private final String subnet;
private final String route;
private final String vrf;

public SetupTungstenVRouterCommand(final String oper, final String inf, final String subnet, final String route,
final String vrf) {
this.oper = oper;
this.inf = inf;
this.subnet = subnet;
this.route = route;
this.vrf = vrf;
}

public String getOper() {
return oper;
}

public String getInf() {
return inf;
}

public String getSubnet() {
return subnet;
}

public String getRoute() {
return route;
}

public String getVrf() {
return vrf;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
SetupTungstenVRouterCommand that = (SetupTungstenVRouterCommand) o;
return Objects.equals(oper, that.oper) && Objects.equals(inf, that.inf) && Objects.equals(subnet, that.subnet) && Objects.equals(route, that.route) && Objects.equals(vrf, that.vrf);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), oper, inf, subnet, route, vrf);
}

@Override
public boolean executeInSequence() {
return false;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.network.tungsten.agent.api;

import com.cloud.agent.api.Command;

import java.util.Objects;

public class UpdateTungstenLoadbalancerSslCommand extends Command {
private final String lbUuid;
private final String sslCertName;
private final String certificateKey;
private final String privateKey;
private final String privateIp;
private final String port;

public UpdateTungstenLoadbalancerSslCommand(final String lbUuid, final String sslCertName,
final String certificateKey, final String privateKey, final String privateIp, final String port) {
this.lbUuid = lbUuid;
this.sslCertName = sslCertName;
this.certificateKey = certificateKey;
this.privateKey = privateKey;
this.privateIp = privateIp;
this.port = port;
}

public String getLbUuid() {
return lbUuid;
}

public String getSslCertName() {
return sslCertName;
}

public String getCertificateKey() {
return certificateKey;
}

public String getPrivateKey() {
return privateKey;
}

public String getPrivateIp() {
return privateIp;
}

public String getPort() {
return port;
}

@Override
public boolean executeInSequence() {
return false;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
UpdateTungstenLoadbalancerSslCommand that = (UpdateTungstenLoadbalancerSslCommand) o;
return Objects.equals(lbUuid, that.lbUuid) && Objects.equals(sslCertName, that.sslCertName) && Objects.equals(certificateKey, that.certificateKey) && Objects.equals(privateKey, that.privateKey) && Objects.equals(privateIp, that.privateIp) && Objects.equals(port, that.port);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), lbUuid, sslCertName, certificateKey, privateKey, privateIp, port);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// Licensed to the Apache Software Foundation (ASF) under one
// or more contributor license agreements. See the NOTICE file
// distributed with this work for additional information
// regarding copyright ownership. The ASF licenses this file
// to you under the Apache License, Version 2.0 (the
// "License"); you may not use this file except in compliance
// with the License. You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing,
// software distributed under the License is distributed on an
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
// KIND, either express or implied. See the License for the
// specific language governing permissions and limitations
// under the License.
package org.apache.cloudstack.network.tungsten.agent.api;

import com.cloud.agent.api.Command;

import java.util.Objects;

public class UpdateTungstenLoadbalancerStatsCommand extends Command {
private final String lbUuid;
private final String lbStatsPort;
private final String lbStatsUri;
private final String lbStatsAuth;

public UpdateTungstenLoadbalancerStatsCommand(final String lbUuid, final String lbStatsPort,
final String lbStatsUri, final String lbStatsAuth) {
this.lbUuid = lbUuid;
this.lbStatsPort = lbStatsPort;
this.lbStatsUri = lbStatsUri;
this.lbStatsAuth = lbStatsAuth;
}

public String getLbUuid() {
return lbUuid;
}

public String getLbStatsPort() {
return lbStatsPort;
}

public String getLbStatsUri() {
return lbStatsUri;
}

public String getLbStatsAuth() {
return lbStatsAuth;
}

@Override
public boolean executeInSequence() {
return false;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
if (!super.equals(o)) return false;
UpdateTungstenLoadbalancerStatsCommand that = (UpdateTungstenLoadbalancerStatsCommand) o;
return Objects.equals(lbUuid, that.lbUuid) && Objects.equals(lbStatsPort, that.lbStatsPort) && Objects.equals(lbStatsUri, that.lbStatsUri) && Objects.equals(lbStatsAuth, that.lbStatsAuth);
}

@Override
public int hashCode() {
return Objects.hash(super.hashCode(), lbUuid, lbStatsPort, lbStatsUri, lbStatsAuth);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -406,7 +406,7 @@ protected UserVm createKubernetesNode(String joinIp) throws ManagementServerExce
if (StringUtils.isNotBlank(kubernetesCluster.getKeyPair())) {
keypairs.add(kubernetesCluster.getKeyPair());
}
if (kubernetesCluster.getSecurityGroupId() != null && networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
if (kubernetesCluster.getSecurityGroupId() != null && networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
List<Long> securityGroupIds = new ArrayList<>();
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
nodeVm = userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, securityGroupIds, owner,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ private UserVm createKubernetesControlNode(final Network network, String serverI
keypairs.add(kubernetesCluster.getKeyPair());
}
if (kubernetesCluster.getSecurityGroupId() != null &&
networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds,
networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds,
List.of(kubernetesCluster.getSecurityGroupId()))) {
List<Long> securityGroupIds = new ArrayList<>();
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
Expand Down Expand Up @@ -294,7 +294,8 @@ private UserVm createKubernetesAdditionalControlNode(final String joinIp, final
keypairs.add(kubernetesCluster.getKeyPair());
}
if (kubernetesCluster.getSecurityGroupId() != null &&
networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds,
List.of(kubernetesCluster.getSecurityGroupId()))) {
List<Long> securityGroupIds = new ArrayList<>();
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
additionalControlVm = userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, securityGroupIds, owner,
Expand Down
Loading

0 comments on commit 21d107c

Please sign in to comment.