Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ func (a *adkApiTranslator) buildManifest(
},
corev1.EnvVar{
Name: "KAGENT_URL",
Value: fmt.Sprintf("http://kagent-controller.%s:8083", utils.GetResourceNamespace()),
Value: fmt.Sprintf("http://%s.%s:8083", utils.GetControllerName(), utils.GetResourceNamespace()),
},
)

Expand Down
9 changes: 9 additions & 0 deletions go/internal/utils/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,15 @@ func GetResourceNamespace() string {
return "kagent"
}

// GetControllerName returns the name for the kagent controller,
// using the KAGENT_CONTROLLER_NAME environment variable or defaulting to "kagent-controller".
func GetControllerName() string {
if val := os.Getenv("KAGENT_CONTROLLER_NAME"); val != "" {
return val
}
return "kagent-controller"
}

// ResourceRefString formats namespace and name as a string reference in "namespace/name" format.
func ResourceRefString(namespace, name string) string {
return fmt.Sprintf("%s/%s", namespace, name)
Expand Down
Loading