https://github.com/kubeflow/katib
Raw File
Tip revision: fc82e20b9933b73431b5fa2d50fc1ab2de144481 authored by IWAMOTO Toshihiro on 26 February 2019, 08:01:53 UTC
studyjobcontroller: requeue Reconcile on error
Tip revision: fc82e20
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