Merge pull request #3424 from shaowenchen/master
fix: pipeline sync annotations
This commit is contained in:
@@ -20,6 +20,9 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"net/http"
|
||||
"strings"
|
||||
|
||||
"github.com/emicklei/go-restful"
|
||||
"k8s.io/apiserver/pkg/authentication/user"
|
||||
log "k8s.io/klog"
|
||||
@@ -33,8 +36,6 @@ import (
|
||||
"kubesphere.io/kubesphere/pkg/server/params"
|
||||
clientDevOps "kubesphere.io/kubesphere/pkg/simple/client/devops"
|
||||
"kubesphere.io/kubesphere/pkg/simple/client/devops/jenkins"
|
||||
"net/http"
|
||||
"strings"
|
||||
)
|
||||
|
||||
const jenkinsHeaderPre = "X-"
|
||||
@@ -131,7 +132,10 @@ func (h *ProjectPipelineHandler) ListPipelines(req *restful.Request, resp *restf
|
||||
} else {
|
||||
for i, _ := range res.Items {
|
||||
if index, ok := pipelineMap[res.Items[i].Name]; ok {
|
||||
// keep annotations field of pipelineList
|
||||
annotations := pipelineList.Items[index].Annotations
|
||||
pipelineList.Items[index] = res.Items[i]
|
||||
pipelineList.Items[index].Annotations = annotations
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user