From a59578c1fa0a898b4e9721d2b89185a00713db43 Mon Sep 17 00:00:00 2001 From: jackyu Date: Thu, 16 Nov 2023 11:59:56 +0800 Subject: [PATCH] fix: scan branch failed when source type is gitsource --- pkg/kapis/devops/v1alpha3/handler.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/kapis/devops/v1alpha3/handler.go b/pkg/kapis/devops/v1alpha3/handler.go index c7126e05..914fa7a0 100644 --- a/pkg/kapis/devops/v1alpha3/handler.go +++ b/pkg/kapis/devops/v1alpha3/handler.go @@ -182,6 +182,12 @@ func (h *devopsHandler) CreatePipeline(request *restful.Request, response *restf return } + // fix: scan branch failed when source type is gitsource + if pipeline.IsMultiBranch() && pipeline.Spec.MultiBranchPipeline.GitSource != nil { + pipeline.Spec.MultiBranchPipeline.GitSource.DiscoverBranches = true + pipeline.Spec.MultiBranchPipeline.GitSource.DiscoverTags = true + } + if client, err := h.getDevOps(request); err == nil { created, err := client.CreatePipelineObj(devops, &pipeline) errorHandle(request, response, created, err)