Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1eeb694

Browse files
committedSep 8, 2022
[installer] add configcat env for proxy
1 parent 0a115cc commit 1eeb694

File tree

3 files changed

+31
-11
lines changed

3 files changed

+31
-11
lines changed
 

Diff for: ‎.werft/jobs/build/installer/installer.ts

+3-4
Original file line numberDiff line numberDiff line change
@@ -248,10 +248,9 @@ EOF`);
248248

249249
private configureConfigCat(slice: string) {
250250
// This key is not a secret, it is a unique identifier of our ConfigCat application
251-
exec(
252-
`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatKey "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"`,
253-
{ slice: slice },
254-
);
251+
exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatKey "WBLaCPtkjkqKHlHedziE9g/LEAOCNkbuUKiqUZAcVg7dw"`, { slice: slice });
252+
exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatBaseUrl "https://cdn-global.configcat.com"`,{ slice: slice });
253+
exec(`yq w -i ${this.options.installerConfigPath} experimental.webapp.configcatPollInterval "10m"`,{ slice: slice });
255254
}
256255

257256
private includeAnalytics(slice: string): void {

Diff for: ‎install/installer/pkg/components/proxy/deployment.go

+25-7
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,30 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
119119
return nil
120120
})
121121

122+
env := common.CustomizeEnvvar(ctx, Component, common.MergeEnv(
123+
common.DefaultEnv(&ctx.Config),
124+
[]corev1.EnvVar{{
125+
Name: "PROXY_DOMAIN",
126+
Value: ctx.Config.Domain,
127+
}},
128+
))
129+
130+
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
131+
if cfg.WebApp != nil {
132+
env = append(env, corev1.EnvVar{
133+
Name: "CONFIGCAT_SDK_KEY",
134+
Value: cfg.WebApp.ConfigcatKey,
135+
}, corev1.EnvVar{
136+
Name: "CONFIGCAT_BASE_URL",
137+
Value: cfg.WebApp.ConfigcatBaseUrl,
138+
}, corev1.EnvVar{
139+
Name: "CONFIGCAT_POLL_INTERVAL",
140+
Value: cfg.WebApp.ConfigcatPollInterval,
141+
})
142+
}
143+
return nil
144+
})
145+
122146
const kubeRbacProxyContainerName = "kube-rbac-proxy"
123147
return []runtime.Object{
124148
&appsv1.Deployment{
@@ -244,13 +268,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
244268
FailureThreshold: 3,
245269
},
246270
VolumeMounts: volumeMounts,
247-
Env: common.CustomizeEnvvar(ctx, Component, common.MergeEnv(
248-
common.DefaultEnv(&ctx.Config),
249-
[]corev1.EnvVar{{
250-
Name: "PROXY_DOMAIN",
251-
Value: ctx.Config.Domain,
252-
}},
253-
)),
271+
Env: env,
254272
}},
255273
},
256274
},

Diff for: ‎install/installer/pkg/config/v1/experimental/experimental.go

+3
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,9 @@ type WebAppConfig struct {
172172
DisableMigration bool `json:"disableMigration"`
173173
Usage *UsageConfig `json:"usage,omitempty"`
174174
ConfigcatKey string `json:"configcatKey"`
175+
ConfigcatBaseUrl string `json:"configcatBaseUrl"`
176+
ConfigcatPollInterval string `json:"configcatPollInterval"`
177+
ConfigcatDefaultConfig string `json:"configcatDefaultConfig"`
175178
WorkspaceClasses []WebAppWorkspaceClass `json:"workspaceClasses"`
176179
}
177180

0 commit comments

Comments
 (0)
Please sign in to comment.