https://github.com/kubeflow/katib
Raw File
Tip revision: 1b542a209ff161e084b7c46edc12eff448d62eaa authored by garganubhav on 13 March 2019, 22:01:04 UTC
Typo correction in nasjob
Tip revision: 1b542a2
types.go
package pkg

import (
	"os"
)

const (
	VizierServiceIPEnvName        = "VIZIER_CORE_PORT_6789_TCP_ADDR"
	VizierServicePortEnvName      = "VIZIER_CORE_PORT_6789_TCP_PORT"
	VizierServiceNamespaceEnvName = "VIZIER_CORE_NAMESPACE"
	VizierService                 = "vizier-core"
	VizierPort                    = "6789"
	ManagerAddr                   = VizierService + ":" + VizierPort
)

func GetManagerAddr() string {
	ns := os.Getenv(VizierServiceNamespaceEnvName)
	if len(ns) == 0 {
		addr := os.Getenv(VizierServiceIPEnvName)
		port := os.Getenv(VizierServicePortEnvName)
		if len(addr) > 0 && len(port) > 0 {
			return addr + ":" + port
		} else {
			return ManagerAddr
		}
	} else {
		return VizierService + "." + ns + ":" + VizierPort
	}
}
back to top