Skip to content

Commit 6e233d3

Browse files
committed
pref: remove debug logs
Signed-off-by: YuTang Song <2313186065@qq.com>
1 parent 5b180cc commit 6e233d3

2 files changed

Lines changed: 9 additions & 15 deletions

File tree

pkg/microservice/aslan/core/common/service/kube/render.go

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1017,15 +1017,9 @@ func RenderEnvServiceWithTempl(prod *commonmodels.Product, serviceRender *templa
10171017
}
10181018

10191019
func GetCluster(clusterID string) (*commonmodels.K8SCluster, error) {
1020-
clusterColl := commonrepo.NewK8SClusterColl()
1021-
log.Infof("GetCluster called with clusterID=%q", clusterID)
1022-
1023-
log.Infof("GetCluster clusterID=%q is a valid object id, querying by id", clusterID)
1024-
cluster, err := clusterColl.FindByID(clusterID)
1020+
cluster, err := commonrepo.NewK8SClusterColl().FindByID(clusterID)
10251021
if err != nil {
1026-
log.Errorf("GetCluster failed to find cluster by id, clusterID=%q, err=%v", clusterID, err)
10271022
return nil, errors.Wrapf(err, "failed to find cluster by id %s", clusterID)
10281023
}
1029-
log.Infof("GetCluster found cluster by id, clusterID=%q, clusterName=%q", clusterID, cluster.Name)
10301024
return cluster, nil
10311025
}

pkg/microservice/aslan/core/common/service/version.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -135,18 +135,18 @@ func GetEnvServiceVersionYaml(ctx *internalhandler.Context, projectName, envName
135135
resp.DeployStrategy = envSvcRevision.DeployStrategy
136136
resp.Containers = envSvcRevision.Service.Containers
137137

138+
if envSvcRevision.ProductFeature.IsHostProduct() {
139+
return resp, nil
140+
}
141+
138142
// for get clusterID
139143
env, err := mongodb.NewProductColl().Find(&mongodb.ProductFindOptions{
140-
Name: envSvcRevision.ProductName,
141-
EnvName: envSvcRevision.EnvName,
142-
Production: &envSvcRevision.Production,
144+
Name: projectName,
145+
EnvName: envName,
146+
Production: &isProduction,
143147
})
144148
if err != nil {
145-
return resp, fmt.Errorf("failed to find %s/%s env, isProduction %v, error: %v", envSvcRevision.ProductName, envSvcRevision.EnvName, envSvcRevision.Production, err)
146-
}
147-
148-
if envSvcRevision.ProductFeature.IsHostProduct() {
149-
return resp, nil
149+
return resp, fmt.Errorf("failed to find %s/%s env, isProduction %v, error: %v", projectName, envName, isProduction, err)
150150
}
151151

152152
if envSvcRevision.Service.Type == setting.K8SDeployType {

0 commit comments

Comments
 (0)