From b70bbcd88dc97a654107974ae6d99c8cc0314a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B1=88=E8=BD=A9?= Date: Thu, 8 Oct 2026 14:34:22 +0800 Subject: [PATCH] fix(host): windows telegraf deploy (#25798) --- pkg/hostman/guestfs/fsdriver/windows.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/hostman/guestfs/fsdriver/windows.go b/pkg/hostman/guestfs/fsdriver/windows.go index 917f1d7003..0139d5b6fb 100644 --- a/pkg/hostman/guestfs/fsdriver/windows.go +++ b/pkg/hostman/guestfs/fsdriver/windows.go @@ -627,9 +627,10 @@ func (w *SWindowsRootFs) DeployTelegraf(config string) (bool, error) { } winTelegrafPath := w.rootFs.GetLocalPath(WIN_TELEGRAF_PATH, true) - telegrafConfPath := path.Join(winTelegrafPath, "telegraf.conf") + // FilePutContents takes a guest path, not a host path from GetLocalPath. + telegrafConfPath := path.Join(WIN_TELEGRAF_PATH, "telegraf.conf") if err := w.rootFs.FilePutContents(telegrafConfPath, config, false, true); err != nil { - return false, errors.Wrap(err, "write boot script") + return false, errors.Wrap(err, "write telegraf config") } telegrafConfPath = strings.ReplaceAll(path.Join("%PROGRAMFILES%", "Telegraf", "telegraf.conf"), "/", "\\")