예제 #1
0
func getApplogEndpointUri() string {
	uri := config.GetConfig().Hostname
	if uri == "" {
		clusterConfig := config.GetClusterConfig()
		uri = strings.Replace(clusterConfig.Endpoint, "api.", "logs.", 1)
	}
	return uri
}
예제 #2
0
func TestGetApplogEndpointUriDefault(t *testing.T) {
	config.GetClusterConfig().Endpoint = "api.stackato.example"
	config.GetConfig().Hostname = ""
	uri := getApplogEndpointUri()
	expected := "logs.stackato.example"
	if uri != expected {
		t.Errorf("Got unexpected applog endpoint uri %v, expected %v",
			uri, expected)
	}
}
예제 #3
0
func TestGetApplogEndpointUriCustom(t *testing.T) {
	config.GetClusterConfig().Endpoint = "api.stackato.example"
	expected := "example.test"
	config.GetConfig().Hostname = expected
	uri := getApplogEndpointUri()
	if uri != expected {
		t.Errorf("Got unexpected applog endpoint uri %v, expected %v",
			uri, expected)
	}
}