From 53a67c9cb7e1d99446c581872d7a1bd2a790d16f Mon Sep 17 00:00:00 2001 From: rameshiyer27 Date: Wed, 8 May 2024 12:01:59 +0100 Subject: Fix chartmuseum sync issue in k8s participant Issue-ID: POLICY-4968 Change-Id: Ieb4b49b4ca40faf1fb8b948e8326decd9c0ae493 Signed-off-by: zrrmmua --- .../policy/clamp/acm/participant/kubernetes/helm/HelmClient.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap') diff --git a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/helm/HelmClient.java b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/helm/HelmClient.java index 8aca5245f..5b13a44a1 100644 --- a/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/helm/HelmClient.java +++ b/participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/helm/HelmClient.java @@ -1,6 +1,6 @@ /*- * ========================LICENSE_START================================= - * Copyright (C) 2021-2023 Nordix Foundation. All rights reserved. + * Copyright (C) 2021-2024 Nordix Foundation. All rights reserved. * ====================================================================== * Modifications Copyright (C) 2021 AT&T Intellectual Property. All rights reserved. * ====================================================================== @@ -81,9 +81,10 @@ public class HelmClient { logger.info("Adding repository to helm client"); executeCommand(prepareRepoAddCommand(repo)); logger.debug("Added repository {} to the helm client", repo.getRepoName()); - return true; + return updateHelmRepo(); } - logger.info("Repository already exists"); + logger.info("Repository already exists, updating the repo"); + updateHelmRepo(); return false; } @@ -270,7 +271,7 @@ public class HelmClient { private boolean updateHelmRepo() { try { - logger.info("Updating local helm repositories before verifying the chart"); + logger.info("Updating local helm repositories"); executeCommand(new ProcessBuilder().command(COMMAND_HELM, "repo", "update")); logger.debug("Helm repositories updated successfully"); } catch (ServiceException e) { -- cgit 1.2.3-korg