From 3abd2f4426f04bb88309df7a7f8281ae0620745b 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 --- pkg/config/cos.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/config/cos.go b/pkg/config/cos.go index f0da78d62..dd298f8b5 100644 --- a/pkg/config/cos.go +++ b/pkg/config/cos.go @@ -351,6 +351,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",