diff options
author | Liam Fallon <liam.fallon@est.tech> | 2021-09-08 08:38:00 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@onap.org> | 2021-09-08 08:38:00 +0000 |
commit | 9b3e8d0c0f5d45a35f80338158ff558ccb2c85b8 (patch) | |
tree | 63f5a1f988fa6a38c216ca69dc8dbab148bf4111 | |
parent | befb22b0987796200647a7a028975dd9567a65d1 (diff) | |
parent | 0457e12450ec0193ed4bc15ee516b35d9a27b845 (diff) |
Merge "Fix bugs on k8s-particpant"
5 files changed, 13 insertions, 6 deletions
diff --git a/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml index d91cc7394..ebd744f13 100644 --- a/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml +++ b/packages/policy-clamp-tarball/src/main/resources/etc/KubernetesParticipantParameters.yaml @@ -7,7 +7,7 @@ security: enable-csrf: false participant: - localChartDirectory: /var/helm-manager/local-charts + localChartDirectory: /home/policy/local-charts infoFileName: CHART_INFO.json intermediaryParameters: reportingTimeIntervalMs: 120000 @@ -51,4 +51,4 @@ logging: org.springframework.data: ERROR org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR file: - name: /var/log/helm-manager/application.log + name: /var/log/onap/policy/clamp/application.log diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/handler/ControlLoopElementHandler.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/handler/ControlLoopElementHandler.java index 24a075529..da0ef134a 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/handler/ControlLoopElementHandler.java +++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/handler/ControlLoopElementHandler.java @@ -143,6 +143,9 @@ public class ControlLoopElementHandler implements ControlLoopElementListener { var config = CODER.convert(nodeTemplate.getProperties(), ThreadConfig.class); checkPodStatus(chartInfo, config.uninitializedToPassiveTimeout, config.podStatusCheckInterval); + intermediaryApi.updateControlLoopElementState(element.getId(), ControlLoopOrderedState.PASSIVE, + ControlLoopState.UNINITIALISED, ParticipantMessageType.CONTROL_LOOP_STATE_CHANGE); + } catch (ServiceException | CoderException | IOException e) { LOGGER.warn("Installation of Helm chart failed", e); } 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 7954dbbb9..1c405539b 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 @@ -183,12 +183,16 @@ public class HelmClient { } private ProcessBuilder prepareRepoAddCommand(HelmRepository repo) { + var url = repo.getProtocol() + "://" + repo.getAddress(); + if (repo.getPort() != null) { + url = url + ":" + repo.getPort(); + } // @formatter:off List<String> helmArguments = new ArrayList<>( List.of( "helm", "repo", - "add", repo.getRepoName(), repo.getProtocol() + "://" + repo.getAddress() + ":" + repo.getPort() + "add", repo.getRepoName(), url )); if (repo.getUserName() != null && repo.getPassword() != null) { helmArguments.addAll(List.of("--username", repo.getUserName(), "--password", repo.getPassword())); diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartService.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartService.java index 770bbb291..a07fca596 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartService.java +++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/controlloop/participant/kubernetes/service/ChartService.java @@ -112,7 +112,7 @@ public class ChartService { * @throws ServiceException incase of error */ public void configureRepository(HelmRepository repo) throws ServiceException { - if (repo.getAddress() != null && repo.getPort() != null) { + if (repo.getAddress() != null) { helmClient.addRepository(repo); } } diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml index 713b072a2..e1693318e 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml +++ b/participant/participant-impl/participant-impl-kubernetes/src/main/resources/config/application.yaml @@ -7,7 +7,7 @@ security: enable-csrf: false participant: - localChartDirectory: /var/helm-manager/local-charts + localChartDirectory: /home/policy/local-charts infoFileName: CHART_INFO.json intermediaryParameters: reportingTimeIntervalMs: 120000 @@ -53,4 +53,4 @@ logging: org.springframework.data: ERROR org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR file: - name: /var/log/helm-manager/application.log + name: /var/log/onap/policy/clamp/application.log |