From 6b65524afe680ace1e729254bdbad7e76d49b773 Mon Sep 17 00:00:00 2001 From: Jack Yu Date: Thu, 16 Nov 2023 12:29:29 +0800 Subject: [PATCH] fix: scan branch failed when source type is gitsource (#1024) --- 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)