Fix chartmuseum sync issue in k8s participant 59/137859/2
authorrameshiyer27 <ramesh.murugan.iyer@est.tech>
Wed, 8 May 2024 11:01:59 +0000 (12:01 +0100)
committerrameshiyer27 <ramesh.murugan.iyer@est.tech>
Fri, 10 May 2024 11:14:27 +0000 (12:14 +0100)
Issue-ID: POLICY-4968
Change-Id: Ieb4b49b4ca40faf1fb8b948e8326decd9c0ae493
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
participant/participant-impl/participant-impl-kubernetes/src/main/java/org/onap/policy/clamp/acm/participant/kubernetes/helm/HelmClient.java

index 8aca524..5b13a44 100644 (file)
@@ -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) {