summaryrefslogtreecommitdiffstats
path: root/participant/participant-impl
diff options
context:
space:
mode:
Diffstat (limited to 'participant/participant-impl')
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/helm/HelmClient.java2
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartStore.java18
-rw-r--r--participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/KubernetesParticipantConfig.json4
3 files changed, 12 insertions, 12 deletions
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/helm/HelmClient.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/helm/HelmClient.java
index 456122f3d..1b7599ce9 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/helm/HelmClient.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/helm/HelmClient.java
@@ -113,8 +113,6 @@ public class HelmClient {
static String executeCommand(ProcessBuilder processBuilder) throws ServiceException {
var commandStr = toString(processBuilder);
- processBuilder.redirectInput(ProcessBuilder.Redirect.DISCARD);
-
try {
var process = processBuilder.start();
process.waitFor();
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartStore.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartStore.java
index 2d0ce7a83..041c0c810 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartStore.java
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartStore.java
@@ -51,8 +51,7 @@ public class ChartStore {
private static final StandardCoder STANDARD_CODER = new StandardCoder();
- @Autowired
- private ParticipantK8sParameters participantK8sParameters;
+ private final ParticipantK8sParameters participantK8sParameters;
/**
* The chartStore map contains chart name as key & ChartInfo as value.
@@ -62,7 +61,8 @@ public class ChartStore {
/**
* Constructor method.
*/
- public ChartStore() {
+ public ChartStore(@Autowired ParticipantK8sParameters participantK8sParameters) {
+ this.participantK8sParameters = participantK8sParameters;
this.restoreFromLocalFileSystem();
}
@@ -177,12 +177,11 @@ public class ChartStore {
}
private synchronized void restoreFromLocalFileSystem() {
- Path localChartDirectoryPath = Paths.get(participantK8sParameters.getLocalChartDirectory());
-
try {
+ Path localChartDirectoryPath = Paths.get(participantK8sParameters.getLocalChartDirectory());
Files.createDirectories(localChartDirectoryPath);
restoreFromLocalFileSystem(localChartDirectoryPath);
- } catch (IOException ioe) {
+ } catch (Exception ioe) {
LOGGER.warn("Could not restore charts from local file system: {}", ioe);
}
}
@@ -194,8 +193,11 @@ public class ChartStore {
@Override
public FileVisitResult visitFile(Path localChartFile, BasicFileAttributes attrs) throws IOException {
try {
- ChartInfo chart = STANDARD_CODER.decode(localChartFile.toFile(), ChartInfo.class);
- localChartMap.put(key(chart), chart);
+ // Decode only the json file excluding the helm charts
+ if (localChartFile.endsWith(participantK8sParameters.getInfoFileName())) {
+ ChartInfo chart = STANDARD_CODER.decode(localChartFile.toFile(), ChartInfo.class);
+ localChartMap.put(key(chart), chart);
+ }
return FileVisitResult.CONTINUE;
} catch (CoderException ce) {
throw new IOException("Error decoding chart file", ce);
diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/KubernetesParticipantConfig.json b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/KubernetesParticipantConfig.json
index 620e05552..e854a9375 100644
--- a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/KubernetesParticipantConfig.json
+++ b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/KubernetesParticipantConfig.json
@@ -49,8 +49,8 @@
"implementation":"org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl",
"databaseDriver":"org.mariadb.jdbc.Driver",
"databaseUrl":"jdbc:mariadb://localhost:3306/controlloop",
- "databaseUser":"admin",
- "databasePassword":"passme",
+ "databaseUser":"policy",
+ "databasePassword":"P01icY",
"persistenceUnit":"ToscaConceptTest"
}
}