diff --git a/src/main/java/org/etsi/osl/controllers/sylva/SylvaMDResourceOperator.java b/src/main/java/org/etsi/osl/controllers/sylva/SylvaMDResourceOperator.java index 93a3bc8a6628c50b9f61a35a7892e7801980006f..4779285419d44a6a5488c99806d6cacdb436ba64 100644 --- a/src/main/java/org/etsi/osl/controllers/sylva/SylvaMDResourceOperator.java +++ b/src/main/java/org/etsi/osl/controllers/sylva/SylvaMDResourceOperator.java @@ -531,21 +531,26 @@ public class SylvaMDResourceOperator { } String command = "./apply-workload-cluster.sh " + deploymentFolderPath; - int exitCode = execCLICommand(command).getExitCode(); - + + ExecResult result = execCLICommand(command); + + int exitCode = result.getExitCode(); + + //resource Kustomization/cr1ae2c130/sylva-units-status is ready! + + if (exitCode == 0) { log.info("Shell script executed successfully in {} for {}", WORKINGDIR_PATH, deploymentFolderPath); resourceClone = updateResourceStatus(resource, SylvaMDResourceState.ACTIVE, "executing apply-workload-cluster.sh success ", client); } else { - log.error("Shell script execution failed in {} for {}. Exit code: {}", WORKINGDIR_PATH, - deploymentFolderPath, exitCode); + log.error("Shell script execution failed in {} for {}. Exit code: {}, Last line: {}", WORKINGDIR_PATH, + deploymentFolderPath, exitCode, result.getLastLine()); resourceClone = updateResourceStatus(resource, SylvaMDResourceState.FAILED, "executing apply-workload-cluster.sh failed", client); - } return resource; @@ -624,6 +629,7 @@ public class SylvaMDResourceOperator { } } catch (IOException e) { e.printStackTrace(); + log.info("==e> {}", e.getLocalizedMessage() ); } }); @@ -647,7 +653,6 @@ public class SylvaMDResourceOperator { errorThread.join(); - if (exitCode == 0) { log.info("execCLICommand executed successfully in {}: {}", WORKINGDIR_PATH, command); } else { diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml new file mode 100644 index 0000000000000000000000000000000000000000..4bed356f6cd701bf3331fe3b52542d2ef7ed2d92 --- /dev/null +++ b/src/main/resources/application.yml @@ -0,0 +1,9 @@ +spring: + application: + name: sylva-osl-operator + main: + web-application-type: none + +server: + port: 0 + \ No newline at end of file