未验证 提交 f1585697 编写于 作者: P Petrus 提交者: GitHub

fix stat issue for helm chart deploy job (#2890)

Signed-off-by: NPatrick Zhao <zhaoyu@koderover.com>
上级 ee40ddd8
......@@ -70,9 +70,12 @@ func (c *JobInfoColl) GetProductionDeployJobs(startTime, endTime int64, projectN
query := bson.M{}
query["start_time"] = bson.M{"$gte": startTime, "$lt": endTime}
query["production"] = true
// TODO: currently the only job type with production env update function is zadig-deploy
// if we added production update for helm-deploy type job, we need to update this query
query["type"] = config.JobZadigDeploy
query["type"] = bson.M{"$in": []string{
string(config.JobZadigDeploy),
string(config.JobZadigHelmDeploy),
string(config.JobZadigHelmChartDeploy),
string(config.JobDeploy),
}}
if len(projectName) != 0 {
query["product_name"] = projectName
}
......@@ -131,7 +134,12 @@ func (c *JobInfoColl) GetBuildJobs(startTime, endTime int64, projectName string)
func (c *JobInfoColl) GetDeployJobs(startTime, endTime int64, projectName string) ([]*models.JobInfo, error) {
query := bson.M{}
query["start_time"] = bson.M{"$gte": startTime, "$lt": endTime}
query["type"] = bson.M{"$in": []string{string(config.JobZadigDeploy), string(config.JobZadigHelmDeploy), string(config.JobDeploy)}}
query["type"] = bson.M{"$in": []string{
string(config.JobZadigDeploy),
string(config.JobZadigHelmDeploy),
string(config.JobZadigHelmChartDeploy),
string(config.JobDeploy),
}}
if len(projectName) != 0 {
query["product_name"] = projectName
......
......@@ -214,7 +214,7 @@ func (c *HelmDeployJobCtl) SaveInfo(ctx context.Context) error {
ServiceName: c.jobTaskSpec.ServiceName,
TargetEnv: c.jobTaskSpec.Env,
ServiceModule: moduleList,
// helm deploy does not have production deploy now
Production: c.jobTaskSpec.IsProduction,
})
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册