Skip to content

Commit

Permalink
[installer] Support enabling protected secrets
Browse files Browse the repository at this point in the history
  • Loading branch information
csweichel committed Sep 30, 2022
1 parent b30f513 commit 9b267f9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
10 changes: 9 additions & 1 deletion install/installer/pkg/components/server/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
return nil
})

defaultFeatureFlags := []NamedWorkspaceFeatureFlag{}
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
if cfg.Workspace != nil && cfg.Workspace.EnableProtectedSecrets {
defaultFeatureFlags = append(defaultFeatureFlags, NamedWorkspaceFeatureProtectedSecrets)
}
return nil
})

// todo(sje): all these values are configurable
scfg := ConfigSerialized{
Version: ctx.VersionManifest.Version,
Expand All @@ -176,7 +184,7 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
WorkspaceDefaults: WorkspaceDefaults{
WorkspaceImage: workspaceImage,
PreviewFeatureFlags: []NamedWorkspaceFeatureFlag{},
DefaultFeatureFlags: []NamedWorkspaceFeatureFlag{},
DefaultFeatureFlags: defaultFeatureFlags,
TimeoutDefault: ctx.Config.Workspace.TimeoutDefault,
TimeoutExtended: ctx.Config.Workspace.TimeoutExtended,
},
Expand Down
1 change: 1 addition & 0 deletions install/installer/pkg/components/server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ type NamedWorkspaceFeatureFlag string

const (
NamedWorkspaceFeatureFlagFullWorkspaceBackup NamedWorkspaceFeatureFlag = "full_workspace_backup"
NamedWorkspaceFeatureProtectedSecrets NamedWorkspaceFeatureFlag = "protected_secrets"
)

type WorkspaceClassCategory string
Expand Down
2 changes: 2 additions & 0 deletions install/installer/pkg/config/v1/experimental/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ type WorkspaceConfig struct {
// Deprecated
UsageReportBucketName string `json:"usageReportBucketName"`
} `json:"contentService"`

EnableProtectedSecrets bool `json:"enableProtectedSecrets"`
}

type PersistentVolumeClaim struct {
Expand Down

0 comments on commit 9b267f9

Please sign in to comment.