Commit b08ea6e0 authored by Christos Tranoris's avatar Christos Tranoris
Browse files

adding error code

parent 318066cc
Loading
Loading
Loading
Loading
Loading
+11 −6
Original line number Diff line number Diff line
@@ -531,7 +531,13 @@ 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) {
@@ -540,12 +546,11 @@ public class SylvaMDResourceOperator {
      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 {
+9 −0
Original line number Diff line number Diff line
spring:
  application:
    name: sylva-osl-operator
  main:
    web-application-type: none

server:
  port: 0
  
 No newline at end of file