From f6bcdc50fdb8f125f6785880909f28c96ead51bc Mon Sep 17 00:00:00 2001 From: shaowenchen Date: Wed, 24 Feb 2021 14:19:09 +0800 Subject: [PATCH] feature: add annotations to pipelines for getting syncstatus Signed-off-by: shaowenchen --- .gitignore | 1 + pkg/kapis/devops/v1alpha2/devops.go | 3 ++- pkg/simple/client/devops/pipeline.go | 5 +++-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 25c28ed9..fffd01e3 100644 --- a/.gitignore +++ b/.gitignore @@ -19,6 +19,7 @@ bin/ # Vscode files .vscode/ +__debug_bin # OSX trash .DS_Store diff --git a/pkg/kapis/devops/v1alpha2/devops.go b/pkg/kapis/devops/v1alpha2/devops.go index e5c6c93f..d845e0b5 100644 --- a/pkg/kapis/devops/v1alpha2/devops.go +++ b/pkg/kapis/devops/v1alpha2/devops.go @@ -112,7 +112,8 @@ func (h *ProjectPipelineHandler) ListPipelines(req *restful.Request, resp *restf } else { pipelineMap[pipeline.Name] = i pipelineList.Items[i] = clientDevOps.Pipeline{ - Name: pipeline.Name, + Name: pipeline.Name, + Annotations: pipeline.Annotations, } } } diff --git a/pkg/simple/client/devops/pipeline.go b/pkg/simple/client/devops/pipeline.go index 0260db4b..00e7c540 100644 --- a/pkg/simple/client/devops/pipeline.go +++ b/pkg/simple/client/devops/pipeline.go @@ -31,8 +31,9 @@ type PipelineList struct { // GetPipeline & SearchPipelines type Pipeline struct { - Class string `json:"_class,omitempty" description:"It’s a fully qualified name and is an identifier of the producer of this resource's capability." ` - Links struct { + Annotations map[string]string `json:"annotations,omitempty" description:"Add annotations from crd" ` + Class string `json:"_class,omitempty" description:"It’s a fully qualified name and is an identifier of the producer of this resource's capability." ` + Links struct { Self struct { Class string `json:"_class,omitempty"` Href string `json:"href,omitempty"` -- GitLab