Skip to content

Commit 58a9ebb

Browse files
easyCZroboquat
authored andcommitted
[experiments] Configure ConfigCat SDK through installer
1 parent 8789ee7 commit 58a9ebb

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

install/installer/pkg/components/server/deployment.go

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
7777
common.WebappTracingEnv(ctx),
7878
common.AnalyticsEnv(&ctx.Config),
7979
common.MessageBusEnv(&ctx.Config),
80+
configcatEnv(ctx),
8081
[]corev1.EnvVar{
8182
{
8283
Name: "CONFIG_PATH",
@@ -398,3 +399,24 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
398399
},
399400
}, nil
400401
}
402+
403+
func configcatEnv(ctx *common.RenderContext) []corev1.EnvVar {
404+
var sdkKey string
405+
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
406+
if cfg.WebApp != nil && cfg.WebApp.ConfigcatKey != "" {
407+
sdkKey = cfg.WebApp.ConfigcatKey
408+
}
409+
return nil
410+
})
411+
412+
if sdkKey == "" {
413+
return nil
414+
}
415+
416+
return []corev1.EnvVar{
417+
{
418+
Name: "CONFIGCAT_SDK_KEY",
419+
Value: sdkKey,
420+
},
421+
}
422+
}

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ type WebAppConfig struct {
103103
UsePodAntiAffinity bool `json:"usePodAntiAffinity"`
104104
DisableMigration bool `json:"disableMigration"`
105105
Usage *UsageConfig `json:"usage,omitempty"`
106+
ConfigcatKey string `json:"configcatKey"`
106107
}
107108

108109
type WorkspaceDefaults struct {

0 commit comments

Comments
 (0)