Code Review
/
dcaegen2
/
platform.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Fix sonar issues
[dcaegen2/platform.git]
/
mod
/
bpgenerator
/
onap
/
src
/
main
/
java
/
org
/
onap
/
blueprintgenerator
/
service
/
common
/
ResourceConfigService.java
diff --git
a/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
b/mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
index
a3a9c97
..
d9bc7b5
100644
(file)
--- a/
mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
+++ b/
mod/bpgenerator/onap/src/main/java/org/onap/blueprintgenerator/service/common/ResourceConfigService.java
@@
-4,6
+4,7
@@
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
* * org.onap.dcae
* * ================================================================================
* * Copyright (c) 2020 AT&T Intellectual Property. All rights reserved.
+ * * Copyright (c) 2021 Nokia. All rights reserved.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
* * ================================================================================
* * Licensed under the Apache License, Version 2.0 (the "License");
* * you may not use this file except in compliance with the License.
@@
-28,10
+29,10
@@
import org.onap.blueprintgenerator.model.common.GetInput;
import org.onap.blueprintgenerator.model.common.ResourceConfig;
import org.onap.blueprintgenerator.service.base.BlueprintHelperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.onap.blueprintgenerator.model.common.ResourceConfig;
import org.onap.blueprintgenerator.service.base.BlueprintHelperService;
import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.util.HashMap;
import org.springframework.stereotype.Service;
import java.util.HashMap;
-import java.util.LinkedHashMap;
import java.util.Map;
import java.util.TreeMap;
import java.util.Map;
import java.util.TreeMap;
@@
-46,6
+47,12
@@
public class ResourceConfigService {
@Autowired
private BlueprintHelperService blueprintHelperService;
@Autowired
private BlueprintHelperService blueprintHelperService;
+ @Value("${resources.cpuLimit}")
+ private String defaultCpuLimit;
+
+ @Value("${resources.memoryLimit}")
+ private String defaultMemoryLimit;
+
/**
* Creates Resouce Config for properties
*
/**
* Creates Resouce Config for properties
*
@@
-54,15
+61,15
@@
public class ResourceConfigService {
* @return
*/
public Map<String, Object> createResourceConfig(
* @return
*/
public Map<String, Object> createResourceConfig(
- Map<String,
LinkedHash
Map<String, Object>> inputs, String name) {
+ Map<String, Map<String, Object>> inputs, String name) {
Map<String, Object> response = new HashMap<>();
ResourceConfig resourceConfig = new ResourceConfig();
Map<String, Object> response = new HashMap<>();
ResourceConfig resourceConfig = new ResourceConfig();
-
LinkedHash
Map<String, Object> memoryLimit =
- blueprintHelperService.createStringInput(
Constants.MEMORY_LIMIT_128Mi
);
+ Map<String, Object> memoryLimit =
+ blueprintHelperService.createStringInput(
defaultMemoryLimit
);
-
LinkedHash
Map<String, Object> cpuLimit =
- blueprintHelperService.createStringInput(
Constants.CPU_LIMIT_250m
);
+ Map<String, Object> cpuLimit =
+ blueprintHelperService.createStringInput(
defaultCpuLimit
);
name = blueprintHelperService.getNamePrefix(name);
name = blueprintHelperService.getNamePrefix(name);