Skip to content

Commit 52d9851

Browse files
committed
[ws-proxy] Fix workspaceHostSuffix for nodomain,pathAndHost
1 parent 9a2f940 commit 52d9851

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed

chart/config/proxy/lib.locations.conf

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,17 @@ location /apps {
7070
proxy_pass http://apiserver$request_uri;
7171
}
7272

73+
##### Blobserve (ingressMode=noDomain,pathAndHost)
74+
{{- $wsProxy := .Values.components.wsProxy -}}
75+
{{- if (and $wsProxy (not $wsProxy.disabled)) }}
76+
location /blobserve {
77+
include lib.proxy.conf;
78+
include lib.cors-headers.conf;
79+
80+
proxy_pass http://wsproxy$request_uri;
81+
}
82+
{{- end }}
83+
7384

7485
##### Gitpod plugins
7586
location /plugins {

chart/templates/ws-proxy-configmap.yaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,13 @@ data:
7777
"gitpodInstallation": {
7878
"scheme": "{{- template "gitpod.scheme" $this -}}",
7979
"hostName": "{{- $gp.hostname -}}",
80-
"workspaceHostSuffix": ".{{- if $gp.installation.shortname -}}ws-{{ $gp.installation.shortname }}{{- else -}}ws{{- end -}}.{{- $gp.hostname -}}"
80+
{{- if eq .Values.ingressMode "hosts" }}
81+
"workspaceHostSuffix": ".ws{{- if $gp.installation.shortname -}}-{{ $.Values.installation.shortname }}{{- end -}}.{{ $.Values.hostname }}"
82+
{{- else if eq .Values.ingressMode "pathAndHost" }}
83+
"workspaceHostSuffix": ""
84+
{{- else }}
85+
"workspaceHostSuffix": ""
86+
{{- end }}
8187
},
8288
"workspacePodConfig": {
8389
"serviceTemplate": "http://ws-{{"{{ .workspaceID }}"}}-theia.{{- .Release.Namespace -}}.svc.cluster.local:{{"{{ .port }}"}}",

components/ws-proxy/pkg/proxy/config.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,7 @@ func (c *GitpodInstallation) Validate() error {
9292

9393
return validation.ValidateStruct(c,
9494
validation.Field(&c.Scheme, validation.Required),
95-
validation.Field(&c.HostName, validation.Required), // TODO IP ONLY: Check if there is any dependency. If yes, remove it.
96-
validation.Field(&c.WorkspaceHostSuffix, validation.Required), // TODO IP ONLY: Check if there is any dependency. If yes, remove it.
95+
validation.Field(&c.HostName, validation.Required), // TODO IP ONLY: Check if there is any dependency. If yes, remove it.
9796
)
9897
}
9998

0 commit comments

Comments
 (0)