From a777721ce7d3144a39cbe0732835f85677937946 Mon Sep 17 00:00:00 2001 From: Hougang Liu Date: Thu, 24 Jan 2019 09:16:26 +0800 Subject: [PATCH] only try to delete study info in db when in need (#342) --- pkg/controller/studyjob/katib_api_util.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/studyjob/katib_api_util.go b/pkg/controller/studyjob/katib_api_util.go index 87e3fc14947..bf7aedd2d31 100644 --- a/pkg/controller/studyjob/katib_api_util.go +++ b/pkg/controller/studyjob/katib_api_util.go @@ -138,6 +138,10 @@ func deleteStudy(instance *katibv1alpha1.StudyJob) error { c := katibapi.NewManagerClient(conn) ctx := context.Background() studyID := instance.Status.StudyID + if studyID == "" { + // in case that information for a studyjob is not created in DB + return nil + } deleteStudyreq := &katibapi.DeleteStudyRequest{ StudyId: studyID, }