@@ -27,10 +27,10 @@ import (
27
27
)
28
28
29
29
type WorkspaceMetadata struct {
30
- WorkspaceId string
31
- Namespace string
32
- PodSelector map [string ]string
33
- RoutingSuffix string
30
+ DevWorkspaceId string
31
+ Namespace string
32
+ PodSelector map [string ]string
33
+ RoutingSuffix string
34
34
}
35
35
36
36
// GetDiscoverableServicesForEndpoints converts the endpoint list into a set of services, each corresponding to a single discoverable
@@ -58,7 +58,7 @@ func GetDiscoverableServicesForEndpoints(endpoints map[string]controllerv1alpha1
58
58
Name : common .EndpointName (endpoint .Name ),
59
59
Namespace : meta .Namespace ,
60
60
Labels : map [string ]string {
61
- constants .DevWorkspaceIDLabel : meta .WorkspaceId ,
61
+ constants .DevWorkspaceIDLabel : meta .DevWorkspaceId ,
62
62
},
63
63
Annotations : map [string ]string {
64
64
constants .WorkspaceDiscoverableServiceAnnotation : "true" ,
@@ -124,10 +124,10 @@ func GetServiceForEndpoints(endpoints map[string]controllerv1alpha1.EndpointList
124
124
125
125
return & corev1.Service {
126
126
ObjectMeta : metav1.ObjectMeta {
127
- Name : common .ServiceName (meta .WorkspaceId ),
127
+ Name : common .ServiceName (meta .DevWorkspaceId ),
128
128
Namespace : meta .Namespace ,
129
129
Labels : map [string ]string {
130
- constants .DevWorkspaceIDLabel : meta .WorkspaceId ,
130
+ constants .DevWorkspaceIDLabel : meta .DevWorkspaceId ,
131
131
},
132
132
},
133
133
Spec : corev1.ServiceSpec {
@@ -184,23 +184,23 @@ func getRouteForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata)
184
184
endpointName := common .EndpointName (endpoint .Name )
185
185
return routeV1.Route {
186
186
ObjectMeta : metav1.ObjectMeta {
187
- Name : common .RouteName (meta .WorkspaceId , endpointName ),
187
+ Name : common .RouteName (meta .DevWorkspaceId , endpointName ),
188
188
Namespace : meta .Namespace ,
189
189
Labels : map [string ]string {
190
- constants .DevWorkspaceIDLabel : meta .WorkspaceId ,
190
+ constants .DevWorkspaceIDLabel : meta .DevWorkspaceId ,
191
191
},
192
192
Annotations : routeAnnotations (endpointName ),
193
193
},
194
194
Spec : routeV1.RouteSpec {
195
- Host : common .WorkspaceHostname (meta .WorkspaceId , meta .RoutingSuffix ),
195
+ Host : common .WorkspaceHostname (meta .DevWorkspaceId , meta .RoutingSuffix ),
196
196
Path : common .EndpointPath (endpointName ),
197
197
TLS : & routeV1.TLSConfig {
198
198
InsecureEdgeTerminationPolicy : routeV1 .InsecureEdgeTerminationPolicyRedirect ,
199
199
Termination : routeV1 .TLSTerminationEdge ,
200
200
},
201
201
To : routeV1.RouteTargetReference {
202
202
Kind : "Service" ,
203
- Name : common .ServiceName (meta .WorkspaceId ),
203
+ Name : common .ServiceName (meta .DevWorkspaceId ),
204
204
},
205
205
Port : & routeV1.RoutePort {
206
206
TargetPort : targetEndpoint ,
@@ -212,14 +212,14 @@ func getRouteForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadata)
212
212
func getIngressForEndpoint (endpoint devworkspace.Endpoint , meta WorkspaceMetadata ) v1beta1.Ingress {
213
213
targetEndpoint := intstr .FromInt (endpoint .TargetPort )
214
214
endpointName := common .EndpointName (endpoint .Name )
215
- hostname := common .EndpointHostname (meta .WorkspaceId , endpointName , endpoint .TargetPort , meta .RoutingSuffix )
215
+ hostname := common .EndpointHostname (meta .DevWorkspaceId , endpointName , endpoint .TargetPort , meta .RoutingSuffix )
216
216
ingressPathType := v1beta1 .PathTypeImplementationSpecific
217
217
return v1beta1.Ingress {
218
218
ObjectMeta : metav1.ObjectMeta {
219
- Name : common .RouteName (meta .WorkspaceId , endpointName ),
219
+ Name : common .RouteName (meta .DevWorkspaceId , endpointName ),
220
220
Namespace : meta .Namespace ,
221
221
Labels : map [string ]string {
222
- constants .DevWorkspaceIDLabel : meta .WorkspaceId ,
222
+ constants .DevWorkspaceIDLabel : meta .DevWorkspaceId ,
223
223
},
224
224
Annotations : nginxIngressAnnotations (endpoint .Name ),
225
225
},
@@ -232,7 +232,7 @@ func getIngressForEndpoint(endpoint devworkspace.Endpoint, meta WorkspaceMetadat
232
232
Paths : []v1beta1.HTTPIngressPath {
233
233
{
234
234
Backend : v1beta1.IngressBackend {
235
- ServiceName : common .ServiceName (meta .WorkspaceId ),
235
+ ServiceName : common .ServiceName (meta .DevWorkspaceId ),
236
236
ServicePort : targetEndpoint ,
237
237
},
238
238
PathType : & ingressPathType ,
0 commit comments