Skip to content

Commit 21d107c

Browse files
committed
Merge branch '4.19'
2 parents a303c7c + 2398b5c commit 21d107c

File tree

26 files changed

+349
-72
lines changed

26 files changed

+349
-72
lines changed

api/src/main/java/com/cloud/network/NetworkModel.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ public interface NetworkModel {
149149

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

152-
Network getNetworkWithSGWithFreeIPs(Long zoneId);
152+
Network getNetworkWithSGWithFreeIPs(Account account, Long zoneId);
153153

154154
Network getNetworkWithSecurityGroupEnabled(Long zoneId);
155155

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

361361
boolean isSecurityGroupSupportedForZone(Long zoneId);
362362

363-
boolean checkSecurityGroupSupportForNetwork(DataCenter zone, List<Long> networkIds,
363+
boolean checkSecurityGroupSupportForNetwork(Account account, DataCenter zone, List<Long> networkIds,
364364
List<Long> securityGroupsIds);
365365
}

client/pom.xml

Lines changed: 5 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,7 @@
2727
<artifactId>cloudstack</artifactId>
2828
<version>4.20.0.0-SNAPSHOT</version>
2929
</parent>
30-
<repositories>
31-
<repository>
32-
<id>juniper-tungsten-api</id>
33-
<url>https://github.com/radu-todirica/tungsten-api/raw/master</url>
34-
</repository>
35-
</repositories>
3630
<dependencies>
37-
<dependency>
38-
<groupId>net.juniper.tungsten</groupId>
39-
<artifactId>juniper-tungsten-api</artifactId>
40-
<version>2.0</version>
41-
</dependency>
4231
<dependency>
4332
<groupId>javax.servlet</groupId>
4433
<artifactId>javax.servlet-api</artifactId>
@@ -282,11 +271,6 @@
282271
<artifactId>cloud-plugin-network-ovs</artifactId>
283272
<version>${project.version}</version>
284273
</dependency>
285-
<dependency>
286-
<groupId>org.apache.cloudstack</groupId>
287-
<artifactId>cloud-plugin-network-tungsten</artifactId>
288-
<version>${project.version}</version>
289-
</dependency>
290274
<dependency>
291275
<groupId>org.apache.cloudstack</groupId>
292276
<artifactId>cloud-plugin-network-elb</artifactId>
@@ -1113,6 +1097,11 @@
11131097
<artifactId>cloud-plugin-network-nsx</artifactId>
11141098
<version>${project.version}</version>
11151099
</dependency>
1100+
<dependency>
1101+
<groupId>org.apache.cloudstack</groupId>
1102+
<artifactId>cloud-plugin-network-tungsten</artifactId>
1103+
<version>${project.version}</version>
1104+
</dependency>
11161105
<dependency>
11171106
<groupId>org.apache.cloudstack</groupId>
11181107
<artifactId>cloud-plugin-api-vmware-sioc</artifactId>

plugins/hypervisors/kvm/pom.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@
8383
<version>${project.version}</version>
8484
<scope>compile</scope>
8585
</dependency>
86-
<dependency>
87-
<groupId>org.apache.cloudstack</groupId>
88-
<artifactId>cloud-plugin-network-tungsten</artifactId>
89-
<version>${project.version}</version>
90-
</dependency>
9186
</dependencies>
9287
<build>
9388
<plugins>
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.network.tungsten.agent.api;
18+
19+
import com.cloud.agent.api.Command;
20+
21+
import java.util.Objects;
22+
23+
public class SetupTfRouteCommand extends Command {
24+
private final String privateIp;
25+
private final String publicIp;
26+
private final String srcNetwork;
27+
28+
public SetupTfRouteCommand(final String privateIp, final String publicIp, final String srcNetwork) {
29+
this.privateIp = privateIp;
30+
this.publicIp = publicIp;
31+
this.srcNetwork = srcNetwork;
32+
}
33+
34+
public String getPrivateIp() {
35+
return privateIp;
36+
}
37+
38+
public String getPublicIp() {
39+
return publicIp;
40+
}
41+
42+
public String getSrcNetwork() {
43+
return srcNetwork;
44+
}
45+
46+
@Override
47+
public boolean equals(Object o) {
48+
if (this == o) return true;
49+
if (o == null || getClass() != o.getClass()) return false;
50+
if (!super.equals(o)) return false;
51+
SetupTfRouteCommand that = (SetupTfRouteCommand) o;
52+
return Objects.equals(privateIp, that.privateIp) && Objects.equals(publicIp, that.publicIp) && Objects.equals(srcNetwork, that.srcNetwork);
53+
}
54+
55+
@Override
56+
public int hashCode() {
57+
return Objects.hash(super.hashCode(), privateIp, publicIp, srcNetwork);
58+
}
59+
60+
@Override
61+
public boolean executeInSequence() {
62+
return false;
63+
}
64+
}
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.network.tungsten.agent.api;
18+
19+
import com.cloud.agent.api.Command;
20+
21+
import java.util.Objects;
22+
23+
public class SetupTungstenVRouterCommand extends Command {
24+
private final String oper;
25+
private final String inf;
26+
private final String subnet;
27+
private final String route;
28+
private final String vrf;
29+
30+
public SetupTungstenVRouterCommand(final String oper, final String inf, final String subnet, final String route,
31+
final String vrf) {
32+
this.oper = oper;
33+
this.inf = inf;
34+
this.subnet = subnet;
35+
this.route = route;
36+
this.vrf = vrf;
37+
}
38+
39+
public String getOper() {
40+
return oper;
41+
}
42+
43+
public String getInf() {
44+
return inf;
45+
}
46+
47+
public String getSubnet() {
48+
return subnet;
49+
}
50+
51+
public String getRoute() {
52+
return route;
53+
}
54+
55+
public String getVrf() {
56+
return vrf;
57+
}
58+
59+
@Override
60+
public boolean equals(Object o) {
61+
if (this == o) return true;
62+
if (o == null || getClass() != o.getClass()) return false;
63+
if (!super.equals(o)) return false;
64+
SetupTungstenVRouterCommand that = (SetupTungstenVRouterCommand) o;
65+
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);
66+
}
67+
68+
@Override
69+
public int hashCode() {
70+
return Objects.hash(super.hashCode(), oper, inf, subnet, route, vrf);
71+
}
72+
73+
@Override
74+
public boolean executeInSequence() {
75+
return false;
76+
}
77+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.network.tungsten.agent.api;
18+
19+
import com.cloud.agent.api.Command;
20+
21+
import java.util.Objects;
22+
23+
public class UpdateTungstenLoadbalancerSslCommand extends Command {
24+
private final String lbUuid;
25+
private final String sslCertName;
26+
private final String certificateKey;
27+
private final String privateKey;
28+
private final String privateIp;
29+
private final String port;
30+
31+
public UpdateTungstenLoadbalancerSslCommand(final String lbUuid, final String sslCertName,
32+
final String certificateKey, final String privateKey, final String privateIp, final String port) {
33+
this.lbUuid = lbUuid;
34+
this.sslCertName = sslCertName;
35+
this.certificateKey = certificateKey;
36+
this.privateKey = privateKey;
37+
this.privateIp = privateIp;
38+
this.port = port;
39+
}
40+
41+
public String getLbUuid() {
42+
return lbUuid;
43+
}
44+
45+
public String getSslCertName() {
46+
return sslCertName;
47+
}
48+
49+
public String getCertificateKey() {
50+
return certificateKey;
51+
}
52+
53+
public String getPrivateKey() {
54+
return privateKey;
55+
}
56+
57+
public String getPrivateIp() {
58+
return privateIp;
59+
}
60+
61+
public String getPort() {
62+
return port;
63+
}
64+
65+
@Override
66+
public boolean executeInSequence() {
67+
return false;
68+
}
69+
70+
@Override
71+
public boolean equals(Object o) {
72+
if (this == o) return true;
73+
if (o == null || getClass() != o.getClass()) return false;
74+
if (!super.equals(o)) return false;
75+
UpdateTungstenLoadbalancerSslCommand that = (UpdateTungstenLoadbalancerSslCommand) o;
76+
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);
77+
}
78+
79+
@Override
80+
public int hashCode() {
81+
return Objects.hash(super.hashCode(), lbUuid, sslCertName, certificateKey, privateKey, privateIp, port);
82+
}
83+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
// Licensed to the Apache Software Foundation (ASF) under one
2+
// or more contributor license agreements. See the NOTICE file
3+
// distributed with this work for additional information
4+
// regarding copyright ownership. The ASF licenses this file
5+
// to you under the Apache License, Version 2.0 (the
6+
// "License"); you may not use this file except in compliance
7+
// with the License. You may obtain a copy of the License at
8+
//
9+
// http://www.apache.org/licenses/LICENSE-2.0
10+
//
11+
// Unless required by applicable law or agreed to in writing,
12+
// software distributed under the License is distributed on an
13+
// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
// KIND, either express or implied. See the License for the
15+
// specific language governing permissions and limitations
16+
// under the License.
17+
package org.apache.cloudstack.network.tungsten.agent.api;
18+
19+
import com.cloud.agent.api.Command;
20+
21+
import java.util.Objects;
22+
23+
public class UpdateTungstenLoadbalancerStatsCommand extends Command {
24+
private final String lbUuid;
25+
private final String lbStatsPort;
26+
private final String lbStatsUri;
27+
private final String lbStatsAuth;
28+
29+
public UpdateTungstenLoadbalancerStatsCommand(final String lbUuid, final String lbStatsPort,
30+
final String lbStatsUri, final String lbStatsAuth) {
31+
this.lbUuid = lbUuid;
32+
this.lbStatsPort = lbStatsPort;
33+
this.lbStatsUri = lbStatsUri;
34+
this.lbStatsAuth = lbStatsAuth;
35+
}
36+
37+
public String getLbUuid() {
38+
return lbUuid;
39+
}
40+
41+
public String getLbStatsPort() {
42+
return lbStatsPort;
43+
}
44+
45+
public String getLbStatsUri() {
46+
return lbStatsUri;
47+
}
48+
49+
public String getLbStatsAuth() {
50+
return lbStatsAuth;
51+
}
52+
53+
@Override
54+
public boolean executeInSequence() {
55+
return false;
56+
}
57+
58+
@Override
59+
public boolean equals(Object o) {
60+
if (this == o) return true;
61+
if (o == null || getClass() != o.getClass()) return false;
62+
if (!super.equals(o)) return false;
63+
UpdateTungstenLoadbalancerStatsCommand that = (UpdateTungstenLoadbalancerStatsCommand) o;
64+
return Objects.equals(lbUuid, that.lbUuid) && Objects.equals(lbStatsPort, that.lbStatsPort) && Objects.equals(lbStatsUri, that.lbStatsUri) && Objects.equals(lbStatsAuth, that.lbStatsAuth);
65+
}
66+
67+
@Override
68+
public int hashCode() {
69+
return Objects.hash(super.hashCode(), lbUuid, lbStatsPort, lbStatsUri, lbStatsAuth);
70+
}
71+
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ protected UserVm createKubernetesNode(String joinIp) throws ManagementServerExce
406406
if (StringUtils.isNotBlank(kubernetesCluster.getKeyPair())) {
407407
keypairs.add(kubernetesCluster.getKeyPair());
408408
}
409-
if (kubernetesCluster.getSecurityGroupId() != null && networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
409+
if (kubernetesCluster.getSecurityGroupId() != null && networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
410410
List<Long> securityGroupIds = new ArrayList<>();
411411
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
412412
nodeVm = userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, securityGroupIds, owner,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ private UserVm createKubernetesControlNode(final Network network, String serverI
217217
keypairs.add(kubernetesCluster.getKeyPair());
218218
}
219219
if (kubernetesCluster.getSecurityGroupId() != null &&
220-
networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds,
220+
networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds,
221221
List.of(kubernetesCluster.getSecurityGroupId()))) {
222222
List<Long> securityGroupIds = new ArrayList<>();
223223
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
@@ -294,7 +294,8 @@ private UserVm createKubernetesAdditionalControlNode(final String joinIp, final
294294
keypairs.add(kubernetesCluster.getKeyPair());
295295
}
296296
if (kubernetesCluster.getSecurityGroupId() != null &&
297-
networkModel.checkSecurityGroupSupportForNetwork(zone, networkIds, List.of(kubernetesCluster.getSecurityGroupId()))) {
297+
networkModel.checkSecurityGroupSupportForNetwork(owner, zone, networkIds,
298+
List.of(kubernetesCluster.getSecurityGroupId()))) {
298299
List<Long> securityGroupIds = new ArrayList<>();
299300
securityGroupIds.add(kubernetesCluster.getSecurityGroupId());
300301
additionalControlVm = userVmService.createAdvancedSecurityGroupVirtualMachine(zone, serviceOffering, clusterTemplate, networkIds, securityGroupIds, owner,

0 commit comments

Comments
 (0)