未验证 提交 a6f46bc8 编写于 作者: R runzexia

fix sonarStatus api NEP, return `[]` if could not get last run

Signed-off-by: Nrunzexia <runzexia@yunify.com>
上级 86c7cf61
......@@ -273,9 +273,12 @@ func GetMultiBranchPipelineSonar(projectId, pipelineId, branchId string) ([]*Son
return nil, restful.NewError(utils.GetJenkinsStatusCode(err), err.Error())
}
build, err := job.GetLastBuild()
if err != nil {
if err != nil && utils.GetJenkinsStatusCode(err) != http.StatusNotFound {
glog.Errorf("%+v", err)
return nil, restful.NewError(utils.GetJenkinsStatusCode(err), err.Error())
} else if err != nil {
glog.Error("%+v", err)
return nil, nil
}
sonarStatus, err := getBuildSonarResults(build)
......@@ -288,6 +291,9 @@ func GetMultiBranchPipelineSonar(projectId, pipelineId, branchId string) ([]*Son
if err != nil && utils.GetJenkinsStatusCode(err) != http.StatusNotFound {
glog.Errorf("%+v", err)
return nil, restful.NewError(utils.GetJenkinsStatusCode(err), err.Error())
} else if err != nil {
glog.Error("%+v", err)
return nil, nil
}
sonarStatus, err = getBuildSonarResults(build)
if err != nil {
......
......@@ -369,7 +369,6 @@ func createOrUpdateRouterWorkload(namespace string, publishService bool, service
}
}
if deployment.Spec.Template.Annotations == nil {
deployment.Spec.Template.Annotations = make(map[string]string, 0)
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册