From d4977d81bb05b929ec5126a709c0ac5c0369d105 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Sat, 13 Sep 2025 00:02:18 +1200 Subject: [PATCH] Read template from .template path Expect to read the rendezvous-host.env template from a separate .template file. The template is placed there by openshift/installer#9941. Only fall back to expecting the .env file to be a template if the former is not present. This change is backward-compatible. --- tools/agent_tui/ui/rendezvous_ip_template.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tools/agent_tui/ui/rendezvous_ip_template.go b/tools/agent_tui/ui/rendezvous_ip_template.go index 45066a38..3d35a52d 100644 --- a/tools/agent_tui/ui/rendezvous_ip_template.go +++ b/tools/agent_tui/ui/rendezvous_ip_template.go @@ -2,6 +2,9 @@ package ui import ( "bytes" + "errors" + "fmt" + "io/fs" "os" "text/template" ) @@ -25,7 +28,10 @@ func (u *UI) saveRendezvousIPAddress(ipAddress string) error { } func templateRendezvousHostEnv(templateData interface{}) error { - data, err := os.ReadFile(RENDEZVOUS_HOST_ENV_PATH) + data, err := os.ReadFile(fmt.Sprintf("%s.template", RENDEZVOUS_HOST_ENV_PATH)) + if errors.Is(err, fs.ErrNotExist) { + data, err = os.ReadFile(RENDEZVOUS_HOST_ENV_PATH) + } if err != nil { return err }