From b10dc00c1bc1a930e5fb9e4320934f5a31d4eebe Mon Sep 17 00:00:00 2001 From: dbb_DingYongliang <62107013+dbbDylan@users.noreply.github.com> Date: Thu, 10 Oct 2024 16:23:16 +0800 Subject: [PATCH] fix: bug fix (#2427) --- pkg/converter/tmpl/template.go | 2 +- pkg/executor/pipeline_executor.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/converter/tmpl/template.go b/pkg/converter/tmpl/template.go index a1241776..1fdeb5a7 100644 --- a/pkg/converter/tmpl/template.go +++ b/pkg/converter/tmpl/template.go @@ -54,7 +54,7 @@ func ParseBool(ctx map[string]any, inputs []string) (bool, error) { // ParseString parse template string to actual string func ParseString(ctx map[string]any, input string) (string, error) { if !IsTmplSyntax(input) { - return input, nil + return strings.Trim(input, "\r\n"), nil } tl, err := internal.Template.Parse(input) diff --git a/pkg/executor/pipeline_executor.go b/pkg/executor/pipeline_executor.go index dd7fdb98..c66878e5 100644 --- a/pkg/executor/pipeline_executor.go +++ b/pkg/executor/pipeline_executor.go @@ -132,6 +132,10 @@ func (e pipelineExecutor) execBatchHosts(ctx context.Context, play kkprojectv1.P } // generate task from role for _, role := range play.Roles { + if !role.Taggable.IsEnabled(e.pipeline.Spec.Tags, e.pipeline.Spec.SkipTags) { + // if not match the tags. skip + continue + } if err := e.variable.Merge(variable.MergeRuntimeVariable(role.Vars, serials...)); err != nil { return fmt.Errorf("merge variable error: %w", err) }