Skip to content
Snippets Groups Projects
Commit a9676c88 authored by xiaohua guan's avatar xiaohua guan Committed by Yas Naoi
Browse files

Issue #3259688 by Xiaohua Guan, yas: Fix an Internal Server Error while creating a K8s CronJob

parent ca776704
No related branches found
No related tags found
No related merge requests found
......@@ -115,6 +115,13 @@ class K8sCreateForm extends K8sContentForm {
? $this->k8sService->$method_name($entity->getNamespace(), $yaml)
: $this->k8sService->$method_name($yaml);
if (!empty($result['kind']) && $result['kind'] === 'Status') {
$this->messenger->addError($result['message']);
$this->logger('k8s')->error($result['message']);
$this->processOperationErrorStatus($entity, 'created');
return FALSE;
}
$result = array_merge($yaml, $result);
$entity = $this->k8sService->createEntityFromYaml($result);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment