From df94305254bca3e484b0d690d77260ef3f065b2c Mon Sep 17 00:00:00 2001 From: yuyuanshifu <747342561@qq.com> Date: Mon, 11 Jan 2021 16:15:52 +0800 Subject: [PATCH] add jobtype judge --- routers/repo/cloudbrain.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/routers/repo/cloudbrain.go b/routers/repo/cloudbrain.go index 98c6457e4..d22d44ced 100755 --- a/routers/repo/cloudbrain.go +++ b/routers/repo/cloudbrain.go @@ -124,6 +124,12 @@ func CloudBrainCreate(ctx *context.Context, form auth.CreateCloudBrainForm) { uuid := form.Attachment jobType := form.JobType codePath := setting.JobPath + jobName + cloudbrain.CodeMountPath + + if jobType != string(models.JobTypeBenchmark) && jobType != string(models.JobTypeDebug) { + log.Error("jobtype error:", jobType) + ctx.RenderWithErr("jobtype error", tplCloudBrainNew, &form) + return + } repo := ctx.Repo.Repository downloadCode(repo, codePath)