Skip to content

Commit 3fc825e

Browse files
committed
Merge remote-tracking branch 'origin/4.17'
2 parents 7ba43e4 + 20420c4 commit 3fc825e

18 files changed

Lines changed: 1808 additions & 34653 deletions

File tree

api/src/main/java/com/cloud/user/ResourceLimitService.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@
2727

2828
public interface ResourceLimitService {
2929

30-
static final ConfigKey<Long> ResourceCountCheckInterval = new ConfigKey<Long>("Advanced", Long.class, "resourcecount.check.interval", "300",
30+
static final ConfigKey<Long> MaxAccountSecondaryStorage = new ConfigKey<>("Account Defaults", Long.class, "max.account.secondary.storage", "400",
31+
"The default maximum secondary storage space (in GiB) that can be used for an account", false);
32+
static final ConfigKey<Long> MaxProjectSecondaryStorage = new ConfigKey<>("Project Defaults", Long.class, "max.project.secondary.storage", "400",
33+
"The default maximum secondary storage space (in GiB) that can be used for a project", false);
34+
static final ConfigKey<Long> ResourceCountCheckInterval = new ConfigKey<>("Advanced", Long.class, "resourcecount.check.interval", "300",
3135
"Time (in seconds) to wait before running resource recalculation and fixing task. Default is 300 seconds, Setting this to 0 disables execution of the task", false);
3236

3337
/**

core/src/main/java/org/apache/cloudstack/storage/command/TemplateOrVolumePostUploadCommand.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public class TemplateOrVolumePostUploadCommand {
4949

5050
String description;
5151

52-
private String defaultMaxAccountSecondaryStorage;
52+
private long defaultMaxSecondaryStorageInGB;
5353

5454
private long processTimeout;
5555

@@ -185,12 +185,12 @@ public void setDescription(String description) {
185185
this.description = description;
186186
}
187187

188-
public void setDefaultMaxAccountSecondaryStorage(String defaultMaxAccountSecondaryStorage) {
189-
this.defaultMaxAccountSecondaryStorage = defaultMaxAccountSecondaryStorage;
188+
public void setDefaultMaxSecondaryStorageInGB(long defaultMaxSecondaryStorageInGB) {
189+
this.defaultMaxSecondaryStorageInGB = defaultMaxSecondaryStorageInGB;
190190
}
191191

192-
public String getDefaultMaxAccountSecondaryStorage() {
193-
return defaultMaxAccountSecondaryStorage;
192+
public long getDefaultMaxSecondaryStorageInGB() {
193+
return defaultMaxSecondaryStorageInGB;
194194
}
195195

196196
public void setAccountId(long accountId) {

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -588,6 +588,7 @@ public KubernetesClusterResponse createKubernetesClusterResponse(long kubernetes
588588
response.setAutoscalingEnabled(kubernetesCluster.getAutoscalingEnabled());
589589
response.setMinSize(kubernetesCluster.getMinSize());
590590
response.setMaxSize(kubernetesCluster.getMaxSize());
591+
response.setCreated(kubernetesCluster.getCreated());
591592
return response;
592593
}
593594

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/version/KubernetesSupportedVersion.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
import org.apache.cloudstack.api.Identity;
2121
import org.apache.cloudstack.api.InternalIdentity;
2222

23+
import java.util.Date;
24+
2325
/**
2426
* KubernetesSupportedVersion describes the properties of supported kubernetes version
2527
*
@@ -36,6 +38,7 @@ public enum State {
3638
long getIsoId();
3739
Long getZoneId();
3840
State getState();
41+
Date getCreated();
3942

4043
/**
4144
* @return minimum # of cpu.

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/version/KubernetesSupportedVersionVO.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,6 +158,7 @@ public void setMinimumRamSize(int minimumRamSize) {
158158
this.minimumRamSize = minimumRamSize;
159159
}
160160

161+
@Override
161162
public Date getCreated() {
162163
return created;
163164
}

plugins/integrations/kubernetes-service/src/main/java/com/cloud/kubernetes/version/KubernetesVersionManagerImpl.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ private KubernetesSupportedVersionResponse createKubernetesSupportedVersionRespo
105105
response.setIsoName(template.getName());
106106
response.setIsoState(template.getState().toString());
107107
}
108+
response.setCreated(kubernetesSupportedVersion.getCreated());
108109
return response;
109110
}
110111

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/response/KubernetesClusterResponse.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package org.apache.cloudstack.api.response;
1818

19+
import java.util.Date;
1920
import java.util.List;
2021

2122
import org.apache.cloudstack.api.ApiConstants;
@@ -158,6 +159,10 @@ public class KubernetesClusterResponse extends BaseResponseWithAnnotations imple
158159
@Param(description = "Maximum size of the cluster")
159160
private Long maxSize;
160161

162+
@SerializedName(ApiConstants.CREATED)
163+
@Param(description = "the date when this Kubernetes cluster was created")
164+
private Date created;
165+
161166
public KubernetesClusterResponse() {
162167
}
163168

@@ -377,4 +382,8 @@ public void setMinSize(Long minSize) {
377382
public void setMaxSize(Long maxSize) {
378383
this.maxSize = maxSize;
379384
}
385+
386+
public void setCreated(Date created) {
387+
this.created = created;
388+
}
380389
}

plugins/integrations/kubernetes-service/src/main/java/org/apache/cloudstack/api/response/KubernetesSupportedVersionResponse.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
import com.cloud.serializer.Param;
2626
import com.google.gson.annotations.SerializedName;
2727

28+
import java.util.Date;
29+
2830
@SuppressWarnings("unused")
2931
@EntityReference(value = {KubernetesSupportedVersion.class})
3032
public class KubernetesSupportedVersionResponse extends BaseResponse {
@@ -80,6 +82,10 @@ public class KubernetesSupportedVersionResponse extends BaseResponse {
8082
@Param(description = "the minimum RAM size in MB needed for the Kubernetes supported version")
8183
private Integer minimumRamSize;
8284

85+
@SerializedName(ApiConstants.CREATED)
86+
@Param(description = "the date when this Kubernetes supported version was created")
87+
private Date created;
88+
8389
public String getId() {
8490
return id;
8591
}
@@ -183,4 +189,8 @@ public Boolean getSupportsAutoscaling() {
183189
public void setSupportsAutoscaling(Boolean supportsAutoscaling) {
184190
this.supportsAutoscaling = supportsAutoscaling;
185191
}
192+
193+
public void setCreated(Date created) {
194+
this.created = created;
195+
}
186196
}

server/src/main/java/com/cloud/configuration/Config.java

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1361,14 +1361,6 @@ public enum Config {
13611361
"200",
13621362
"The default maximum primary storage space (in GiB) that can be used for an account",
13631363
null),
1364-
DefaultMaxAccountSecondaryStorage(
1365-
"Account Defaults",
1366-
ManagementServer.class,
1367-
Long.class,
1368-
"max.account.secondary.storage",
1369-
"400",
1370-
"The default maximum secondary storage space (in GiB) that can be used for an account",
1371-
null),
13721364

13731365
//disabling lb as cluster sync does not work with distributed cluster
13741366
SubDomainNetworkAccess(
@@ -1497,14 +1489,6 @@ public enum Config {
14971489
"200",
14981490
"The default maximum primary storage space (in GiB) that can be used for an project",
14991491
null),
1500-
DefaultMaxProjectSecondaryStorage(
1501-
"Project Defaults",
1502-
ManagementServer.class,
1503-
Long.class,
1504-
"max.project.secondary.storage",
1505-
"400",
1506-
"The default maximum secondary storage space (in GiB) that can be used for an project",
1507-
null),
15081492

15091493
ProjectInviteRequired(
15101494
"Project Defaults",

server/src/main/java/com/cloud/network/lb/LoadBalancingRulesManagerImpl.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
import org.apache.cloudstack.framework.config.dao.ConfigurationDao;
4848
import org.apache.cloudstack.lb.ApplicationLoadBalancerRuleVO;
4949
import org.apache.cloudstack.lb.dao.ApplicationLoadBalancerRuleDao;
50+
import org.apache.commons.lang3.StringUtils;
5051
import org.apache.log4j.Logger;
5152

5253
import com.cloud.agent.api.to.LoadBalancerTO;
@@ -2105,6 +2106,7 @@ public LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd) {
21052106
LoadBalancerVO lbBackup = _lbDao.findById(lbRuleId);
21062107
String customId = cmd.getCustomId();
21072108
Boolean forDisplay = cmd.getDisplay();
2109+
String lbProtocol = cmd.getLbProtocol();
21082110

21092111
if (lb == null) {
21102112
throw new InvalidParameterValueException("Unable to find lb rule by id=" + lbRuleId);
@@ -2133,6 +2135,10 @@ public LoadBalancer updateLoadBalancerRule(UpdateLoadBalancerRuleCmd cmd) {
21332135
lb.setDisplay(forDisplay);
21342136
}
21352137

2138+
if (StringUtils.isNotBlank(lbProtocol)) {
2139+
lb.setLbProtocol(lbProtocol);
2140+
}
2141+
21362142
// Validate rule in LB provider
21372143
LoadBalancingRule rule = getLoadBalancerRuleToApply(lb);
21382144
if (!validateLbRule(rule)) {

0 commit comments

Comments
 (0)