Skip to content

Commit d19ae75

Browse files
committed
installer: make OpenVSX URL configurable
Fixes #8224 This PR adds a new `OpenVSX` object into the top-level `Config` field to support configurations of the `openvsx-proxy` component. Currently, Only `URL` field is present. This is needed to support air-gap instlalations where people are expected to host their own open-vsx. This config is top-level and not under the workspace or IDE as this configures the proxy, but not the IDE. The URL is validated by using the validate go tags. Signed-off-by: Tarun Pothulapati <[email protected]>
1 parent 30da763 commit d19ae75

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

components/installer/pkg/components/openvsx-proxy/configmap.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
2222
LogDebug: false,
2323
CacheDurationRegular: util.Duration(time.Minute),
2424
CacheDurationBackup: util.Duration(time.Hour * 72),
25-
URLUpstream: "https://open-vsx.org", // todo(sje): make configurable
25+
URLUpstream: ctx.Config.OpenVSX.URL,
2626
URLLocal: fmt.Sprintf("https://open-vsx.%s", ctx.Config.Domain),
2727
MaxIdleConns: 1000,
2828
MaxIdleConnsPerHost: 1000,

components/installer/pkg/config/v1/config.go

+7
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ func (v version) Defaults(in interface{}) error {
5555
cfg.Workspace.Runtime.FSShiftMethod = FSShiftShiftFS
5656
cfg.Workspace.Runtime.ContainerDSocket = "/run/containerd/containerd.sock"
5757
cfg.Workspace.Runtime.ContainerDRuntimeDir = "/var/lib/containerd/io.containerd.runtime.v2.task/k8s.io"
58+
cfg.OpenVSX.URL = "https://open-vsx.org"
5859

5960
return nil
6061
}
@@ -82,6 +83,8 @@ type Config struct {
8283

8384
Workspace Workspace `json:"workspace" validate:"required"`
8485

86+
OpenVSX OpenVSX `json:"openVSX"`
87+
8588
AuthProviders []ObjectRef `json:"authProviders" validate:"dive"`
8689
BlockNewUsers BlockNewUsers `json:"blockNewUsers"`
8790
License *ObjectRef `json:"license,omitempty"`
@@ -227,6 +230,10 @@ type Workspace struct {
227230
Templates *WorkspaceTemplates `json:"templates,omitempty"`
228231
}
229232

233+
type OpenVSX struct {
234+
URL string `json:"url" validate:"url"`
235+
}
236+
230237
type FSShiftMethod string
231238

232239
const (

components/installer/pkg/config/v1/load.go

+3
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ func LoadMock() *Config {
5050
Kind: ObjectRefSecret,
5151
Name: "https-certs",
5252
},
53+
OpenVSX: OpenVSX{
54+
URL: "https://open-vsx.org",
55+
},
5356
Workspace: Workspace{
5457
Runtime: WorkspaceRuntime{
5558
FSShiftMethod: FSShiftFuseFS,

0 commit comments

Comments
 (0)