Skip to content

Commit

Permalink
installer: make OpenVSX URL configurable
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
Pothulapati authored and roboquat committed Feb 22, 2022
1 parent ddc80c1 commit d9b9f30
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
LogDebug: false,
CacheDurationRegular: util.Duration(time.Minute),
CacheDurationBackup: util.Duration(time.Hour * 72),
URLUpstream: "https://open-vsx.org", // todo(sje): make configurable
URLUpstream: ctx.Config.OpenVSX.URL,
URLLocal: fmt.Sprintf("https://open-vsx.%s", ctx.Config.Domain),
MaxIdleConns: 1000,
MaxIdleConnsPerHost: 1000,
Expand Down
7 changes: 7 additions & 0 deletions install/installer/pkg/config/v1/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func (v version) Defaults(in interface{}) error {
cfg.Workspace.Runtime.FSShiftMethod = FSShiftFuseFS
cfg.Workspace.Runtime.ContainerDSocket = "/run/containerd/containerd.sock"
cfg.Workspace.Runtime.ContainerDRuntimeDir = "/var/lib/containerd/io.containerd.runtime.v2.task/k8s.io"
cfg.OpenVSX.URL = "https://open-vsx.org"

return nil
}
Expand Down Expand Up @@ -82,6 +83,8 @@ type Config struct {

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

OpenVSX OpenVSX `json:"openVSX"`

AuthProviders []ObjectRef `json:"authProviders" validate:"dive"`
BlockNewUsers BlockNewUsers `json:"blockNewUsers"`
License *ObjectRef `json:"license,omitempty"`
Expand Down Expand Up @@ -229,6 +232,10 @@ type Workspace struct {
Templates *WorkspaceTemplates `json:"templates,omitempty"`
}

type OpenVSX struct {
URL string `json:"url" validate:"url"`
}

type FSShiftMethod string

const (
Expand Down
3 changes: 3 additions & 0 deletions install/installer/pkg/config/v1/load.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,9 @@ func LoadMock() *Config {
Kind: ObjectRefSecret,
Name: "https-certs",
},
OpenVSX: OpenVSX{
URL: "https://open-vsx.org",
},
Workspace: Workspace{
Runtime: WorkspaceRuntime{
FSShiftMethod: FSShiftFuseFS,
Expand Down

0 comments on commit d9b9f30

Please sign in to comment.