Skip to content

Commit 2ff3043

Browse files
committed
[installer] Actually add 'inactivityPeriodForRepos' to server configmap
1 parent dd97e9e commit 2ff3043

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

Diff for: install/installer/pkg/components/server/configmap.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
176176
return nil
177177
})
178178

179+
inactivityPeriodForRepos := 0
180+
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
181+
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.InactivityPeriodForRepos != nil {
182+
inactivityPeriodForRepos = *cfg.WebApp.Server.InactivityPeriodForRepos
183+
}
184+
return nil
185+
})
186+
179187
// todo(sje): all these values are configurable
180188
scfg := ConfigSerialized{
181189
Version: ctx.VersionManifest.Version,
@@ -263,7 +271,8 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
263271
// default limit for all cloneURLs
264272
"*": 50,
265273
},
266-
WorkspaceClasses: workspaceClasses,
274+
WorkspaceClasses: workspaceClasses,
275+
InactivityPeriodForRepos: inactivityPeriodForRepos,
267276
}
268277

269278
fc, err := common.ToJSONString(scfg)

Diff for: install/installer/pkg/components/server/types.go

+3-2
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,9 @@ type ConfigSerialized struct {
5252
CodeSync CodeSync `json:"codeSync"`
5353
// PrebuildLimiter defines the number of prebuilds allowed for each cloneURL in a given 1 minute interval
5454
// Key of "*" defines the default limit, unless there exists a cloneURL in the map which overrides it.
55-
PrebuildLimiter map[string]int `json:"prebuildLimiter"`
56-
WorkspaceClasses []WorkspaceClass `json:"workspaceClasses"`
55+
PrebuildLimiter map[string]int `json:"prebuildLimiter"`
56+
WorkspaceClasses []WorkspaceClass `json:"workspaceClasses"`
57+
InactivityPeriodForRepos int `json:"inactivityPeriodForRepos"`
5758
}
5859
type CodeSyncResources struct {
5960
RevLimit int32 `json:"revLimit"`

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

+1
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ type ServerConfig struct {
232232
EnableLocalApp *bool `json:"enableLocalApp"`
233233
RunDbDeleter *bool `json:"runDbDeleter"`
234234
DisableWorkspaceGarbageCollection bool `json:"disableWorkspaceGarbageCollection"`
235+
InactivityPeriodForRepos int `json:"inactivityPeriodForRepos"`
235236

236237
// @deprecated use containerRegistry.privateBaseImageAllowList instead
237238
DefaultBaseImageRegistryWhiteList []string `json:"defaultBaseImageRegistryWhitelist"`

0 commit comments

Comments
 (0)