Преглед изворни кода

Merge pull request #15099 from jakesmith/hpcc-26106-kubectl-errors

HPCC-26106 Report kubectl error in exception text

Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman пре 4 година
родитељ
комит
bd216c389e
1 измењених фајлова са 10 додато и 2 уклоњено
  1. 10 2
      common/workunit/workunit.cpp

+ 10 - 2
common/workunit/workunit.cpp

@@ -14148,7 +14148,12 @@ void deleteK8sResource(const char *componentName, const char *job, const char *r
     if (error.length())
         DBGLOG("kubectl delete error: %s", error.trimRight().str());
     if (ret)
-        throw makeStringException(0, "Failed to run kubectl delete");
+    {
+        StringBuffer errorText("Failed to run kubectl delete");
+        if (error.length())
+            errorText.append(", error: ").append(error);
+        throw makeStringException(0, errorText);
+    }
 }
 
 void waitK8sJob(const char *componentName, const char *job, unsigned pendingTimeoutSecs, KeepK8sJobs keepJob)
@@ -14274,7 +14279,10 @@ bool applyK8sYaml(const char *componentName, const char *wuid, const char *job,
     if (ret)
     {
         DBGLOG("Using yaml %s", jobYaml.str());
-        throw makeStringException(0, "Failed to replace k8s resource");
+        StringBuffer errorText("Failed to replace k8s resource");
+        if (error.length())
+            errorText.append(", error: ").append(error);
+        throw makeStringException(0, errorText);
     }
     return true;
 }