Skip to content

Commit 81b991c

Browse files
authored
[openvsx-proxy] Pass in proxy settings as env vars (#19364)
* [openvsx-proxy] Pass in proxy settings as env vars * remove unnecessary env var
1 parent b7d39c0 commit 81b991c

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

install/installer/pkg/components/openvsx-proxy/statefulset.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,29 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
6666

6767
const redisContainerName = "redis"
6868

69+
var proxyEnvVars []v1.EnvVar
70+
if ctx.Config.Experimental != nil && ctx.Config.Experimental.WebApp != nil {
71+
proxyConfig := ctx.Config.Experimental.WebApp.ProxySettings
72+
if proxyConfig != nil {
73+
proxyEnvVars = []v1.EnvVar{
74+
{
75+
Name: "HTTP_PROXY",
76+
Value: proxyConfig.HttpProxy,
77+
},
78+
{
79+
Name: "HTTPS_PROXY",
80+
Value: proxyConfig.HttpsProxy,
81+
},
82+
{
83+
Name: "NO_PROXY",
84+
Value: proxyConfig.HttpsProxy,
85+
},
86+
}
87+
88+
}
89+
90+
}
91+
6992
return []runtime.Object{&appsv1.StatefulSet{
7093
TypeMeta: common.TypeMetaStatefulSet,
7194
ObjectMeta: metav1.ObjectMeta{
@@ -136,6 +159,7 @@ func statefulset(ctx *common.RenderContext) ([]runtime.Object, error) {
136159
Env: common.CustomizeEnvvar(ctx, Component, common.MergeEnv(
137160
common.DefaultEnv(&ctx.Config),
138161
common.ConfigcatEnv(ctx),
162+
proxyEnvVars,
139163
)),
140164
}, {
141165
Name: redisContainerName,

install/installer/pkg/config/v1/experimental/experimental.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,15 @@ type WebAppConfig struct {
209209
SpiceDB *SpiceDBConfig `json:"spicedb,omitempty"`
210210
CertmanagerNamespaceOverride string `json:"certmanagerNamespaceOverride,omitempty"`
211211
Redis *RedisConfig `json:"redis"`
212+
213+
// ProxySettings is used if the gitpod cell uses some proxy for connectivity
214+
ProxySettings *ProxySettings `json:"proxySettings"`
215+
}
216+
217+
type ProxySettings struct {
218+
HttpProxy string `json:"http_proxy"`
219+
HttpsProxy string `json:"https_proxy"`
220+
NoProxy string `json:"no_proxy"`
212221
}
213222

214223
type WorkspaceDefaults struct {

0 commit comments

Comments
 (0)