@@ -78,6 +78,10 @@ const (
78
78
stateMsgRunning = "Workspace is running"
79
79
stateMsgTerminating = "Workspace is terminating"
80
80
stateMsgUnknown = "Workspace is in an unknown state"
81
+
82
+ IstioHost = "ISTIO_HOST"
83
+ IstioGateway = "ISTIO_GATEWAY"
84
+ ClusterDomain = "CLUSTER_DOMAIN"
81
85
)
82
86
83
87
// WorkspaceReconciler reconciles a Workspace object
@@ -1037,13 +1041,13 @@ func GenerateIstioVirtualService(workspace *kubefloworgv1beta1.Workspace, worksp
1037
1041
virtualService .SetNamespace (workspace .Namespace )
1038
1042
1039
1043
// .spec.gateways
1040
- istioGateway := getEnvOrDefault ("ISTIO_GATEWAY" , "kubeflow/kubeflow-gateway" )
1044
+ istioGateway := getEnvOrDefault (IstioGateway , "kubeflow/kubeflow-gateway" )
1041
1045
if err := unstructured .SetNestedStringSlice (virtualService .Object , []string {istioGateway },
1042
1046
"spec" , "gateways" ); err != nil {
1043
1047
return nil , fmt .Errorf ("set .spec.gateways error: %v" , err )
1044
1048
}
1045
1049
1046
- istioHost := getEnvOrDefault ("ISTIO_HOST" , "*" )
1050
+ istioHost := getEnvOrDefault (IstioHost , "*" )
1047
1051
if err := unstructured .SetNestedStringSlice (virtualService .Object , []string {istioHost },
1048
1052
"spec" , "gateways" ); err != nil {
1049
1053
return nil , fmt .Errorf ("set .spec.hosts error: %v" , err )
@@ -1057,7 +1061,7 @@ func GenerateIstioVirtualService(workspace *kubefloworgv1beta1.Workspace, worksp
1057
1061
1058
1062
var httpRoutes []interface {}
1059
1063
1060
- host := fmt .Sprintf ("%s.%s.svc.%s" , serviceName , workspace .Namespace , getEnvOrDefault ("CLUSTER_DOMAIN" , "cluster.local" ))
1064
+ host := fmt .Sprintf ("%s.%s.svc.%s" , serviceName , workspace .Namespace , getEnvOrDefault (ClusterDomain , "cluster.local" ))
1061
1065
1062
1066
// generate container ports
1063
1067
// TODO: It can be better
0 commit comments