From c2f64ab828f6607b2590cf046daa8cd217168983 Mon Sep 17 00:00:00 2001 From: PoAn Yang Date: Wed, 1 Nov 2023 17:28:31 +0800 Subject: [PATCH] fix: trim space for harvester-agent file Signed-off-by: PoAn Yang (cherry picked from commit 3abd2f4426f04bb88309df7a7f8281ae0620745b) --- pkg/config/cos.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/cos.go b/pkg/config/cos.go index 6051c9448..f9c68f566 100644 --- a/pkg/config/cos.go +++ b/pkg/config/cos.go @@ -303,6 +303,9 @@ func initRancherdStage(config *HarvesterConfig, stage *yipSchema.Stage) error { if err != nil { return err } + + // remove space, so we don't get result like |2 or |4 in the yaml + rke2AgentConfig = strings.TrimSpace(rke2AgentConfig) stage.Files = append(stage.Files, yipSchema.File{ Path: "/etc/rancher/rke2/config.yaml.d/90-harvester-agent.yaml",