From 6ab31eea35fec6faad81e4f4503b25ee342bad54 Mon Sep 17 00:00:00 2001 From: Zane Bitter Date: Thu, 11 Sep 2025 17:55:38 +1200 Subject: [PATCH] Create UI URLs unconditionally It doesn't hurt to have them. --- pkg/asset/agent/image/ignition.go | 19 +++++++------------ pkg/asset/agent/image/ignition_test.go | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/pkg/asset/agent/image/ignition.go b/pkg/asset/agent/image/ignition.go index 09f7cd977a..fa842cda6c 100644 --- a/pkg/asset/agent/image/ignition.go +++ b/pkg/asset/agent/image/ignition.go @@ -457,6 +457,11 @@ func getRendezvousHostEnv(serviceProtocol, nodeZeroIP, agentAuthtoken, userAuthT Host: net.JoinHostPort(nodeZeroIP, "8888"), Path: "/", } + uiBaseURL := url.URL{ + Scheme: serviceProtocol, + Host: net.JoinHostPort(nodeZeroIP, "3001"), + Path: "/", + } // USER_AUTH_TOKEN is required to authenticate API requests against agent-installer-local auth type // and for the endpoints marked with userAuth security definition in assisted-service swagger.yaml. // PULL_SECRET_TOKEN contains the AGENT_AUTH_TOKEN and is required for the endpoints marked with agentAuth security definition in assisted-service swagger.yaml. @@ -475,19 +480,9 @@ IMAGE_SERVICE_BASE_URL=%s PULL_SECRET_TOKEN=%s USER_AUTH_TOKEN=%s WORKFLOW_TYPE=%s -`, nodeZeroIP, serviceBaseURL.String(), imageServiceBaseURL.String(), agentAuthtoken, userAuthToken, workflowType) - - if workflowType == workflow.AgentWorkflowTypeInstallInteractiveDisconnected { - uiBaseURL := url.URL{ - Scheme: serviceProtocol, - Host: net.JoinHostPort(nodeZeroIP, "3001"), - Path: "/", - } - uiEnv := fmt.Sprintf(`AIUI_APP_API_URL=%s +AIUI_APP_API_URL=%s AIUI_URL=%s -`, serviceBaseURL.String(), uiBaseURL.String()) - rendezvousHostEnv = fmt.Sprintf("%s%s", rendezvousHostEnv, uiEnv) - } +`, nodeZeroIP, serviceBaseURL.String(), imageServiceBaseURL.String(), agentAuthtoken, userAuthToken, workflowType, serviceBaseURL.String(), uiBaseURL.String()) return rendezvousHostEnv } diff --git a/pkg/asset/agent/image/ignition_test.go b/pkg/asset/agent/image/ignition_test.go index 7b6bcaf5ee..757172625d 100644 --- a/pkg/asset/agent/image/ignition_test.go +++ b/pkg/asset/agent/image/ignition_test.go @@ -126,7 +126,7 @@ func TestIgnition_getRendezvousHostEnv(t *testing.T) { userAuthToken := "userAuthToken" rendezvousHostEnv := getRendezvousHostEnv("http", nodeZeroIP, agentAuthtoken, userAuthToken, workflow.AgentWorkflowTypeInstall) assert.Equal(t, - "NODE_ZERO_IP="+nodeZeroIP+"\nSERVICE_BASE_URL=http://["+nodeZeroIP+"]:8090/\nIMAGE_SERVICE_BASE_URL=http://["+nodeZeroIP+"]:8888/\nPULL_SECRET_TOKEN="+agentAuthtoken+"\nUSER_AUTH_TOKEN="+userAuthToken+"\nWORKFLOW_TYPE=install\n", + "NODE_ZERO_IP="+nodeZeroIP+"\nSERVICE_BASE_URL=http://["+nodeZeroIP+"]:8090/\nIMAGE_SERVICE_BASE_URL=http://["+nodeZeroIP+"]:8888/\nPULL_SECRET_TOKEN="+agentAuthtoken+"\nUSER_AUTH_TOKEN="+userAuthToken+"\nWORKFLOW_TYPE=install\nAIUI_APP_API_URL=http://["+nodeZeroIP+"]:8090/\nAIUI_URL=http://["+nodeZeroIP+"]:3001/\n", rendezvousHostEnv) }