From 82297c6e7d89309fba3ad5f4066a6340c160edbe Mon Sep 17 00:00:00 2001 From: KubeSphere CI Bot <47586280+ks-ci-bot@users.noreply.github.com> Date: Tue, 15 Aug 2023 16:27:50 +0800 Subject: [PATCH] disable discarded history pipelineruns (#989) Co-authored-by: jackyu --- pkg/client/devops/jenkins/pipeline_internal.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/client/devops/jenkins/pipeline_internal.go b/pkg/client/devops/jenkins/pipeline_internal.go index dd26c16b..484d0601 100644 --- a/pkg/client/devops/jenkins/pipeline_internal.go +++ b/pkg/client/devops/jenkins/pipeline_internal.go @@ -138,6 +138,8 @@ func updatePipelineConfigXml(config string, pipeline *devopsv1alpha3.NoScmPipeli addOrUpdateElement(strategy, NumToKeepTag, pipeline.Discarder.NumToKeep) addOrUpdateElement(strategy, ArtiDaysToKeepTag, "-1") addOrUpdateElement(strategy, ArtiNumToKeepTag, "-1") + } else { + removeChildElement(properties, BuildDiscarderTag) } if pipeline.Parameters != nil { // overwrite parameters