Skip to content

Commit 8552127

Browse files
[installer] Support enabling protected secrets (#13545)
Co-authored-by: Christian Weichel <[email protected]>
1 parent 2e29167 commit 8552127

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
162162
return nil
163163
})
164164

165+
defaultFeatureFlags := []NamedWorkspaceFeatureFlag{}
166+
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
167+
if cfg.Workspace != nil && cfg.Workspace.EnableProtectedSecrets {
168+
defaultFeatureFlags = append(defaultFeatureFlags, NamedWorkspaceFeatureProtectedSecrets)
169+
}
170+
return nil
171+
})
172+
165173
// todo(sje): all these values are configurable
166174
scfg := ConfigSerialized{
167175
Version: ctx.VersionManifest.Version,
@@ -175,7 +183,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
175183
WorkspaceDefaults: WorkspaceDefaults{
176184
WorkspaceImage: workspaceImage,
177185
PreviewFeatureFlags: []NamedWorkspaceFeatureFlag{},
178-
DefaultFeatureFlags: []NamedWorkspaceFeatureFlag{},
186+
DefaultFeatureFlags: defaultFeatureFlags,
179187
TimeoutDefault: ctx.Config.Workspace.TimeoutDefault,
180188
TimeoutExtended: ctx.Config.Workspace.TimeoutExtended,
181189
},

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ type NamedWorkspaceFeatureFlag string
147147

148148
const (
149149
NamedWorkspaceFeatureFlagFullWorkspaceBackup NamedWorkspaceFeatureFlag = "full_workspace_backup"
150+
NamedWorkspaceFeatureProtectedSecrets NamedWorkspaceFeatureFlag = "protected_secrets"
150151
)
151152

152153
type WorkspaceClassCategory string

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ type WorkspaceConfig struct {
119119
// Deprecated
120120
UsageReportBucketName string `json:"usageReportBucketName"`
121121
} `json:"contentService"`
122+
123+
EnableProtectedSecrets bool `json:"enableProtectedSecrets"`
122124
}
123125

124126
type PersistentVolumeClaim struct {

0 commit comments

Comments
 (0)