Skip to content

Commit 2021e83

Browse files
Andrew Farriesroboquat
authored andcommitted
Move server config under webapp.server config
1 parent 7d96932 commit 2021e83

2 files changed

Lines changed: 20 additions & 16 deletions

File tree

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

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
2121
return nil, err
2222
}
2323
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
24-
if cfg.WebApp != nil && cfg.WebApp.OAuthServer.JWTSecret != "" {
25-
jwtSecret = cfg.WebApp.OAuthServer.JWTSecret
24+
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.OAuthServer.JWTSecret != "" {
25+
jwtSecret = cfg.WebApp.Server.OAuthServer.JWTSecret
2626
}
2727
return nil
2828
})
@@ -34,31 +34,31 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
3434

3535
workspaceImage := common.ImageName(common.ThirdPartyContainerRepo(ctx.Config.Repository, ""), workspace.DefaultWorkspaceImage, workspace.DefaultWorkspaceImageVersion)
3636
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
37-
if cfg.WebApp != nil && cfg.WebApp.WorkspaceDefaults.WorkspaceImage != "" {
38-
workspaceImage = cfg.WebApp.WorkspaceDefaults.WorkspaceImage
37+
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.WorkspaceDefaults.WorkspaceImage != "" {
38+
workspaceImage = cfg.WebApp.Server.WorkspaceDefaults.WorkspaceImage
3939
}
4040
return nil
4141
})
4242

4343
sessionSecret := "Important!Really-Change-This-Key!"
4444
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
45-
if cfg.WebApp != nil && cfg.WebApp.Session.Secret != "" {
46-
sessionSecret = cfg.WebApp.Session.Secret
45+
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.Session.Secret != "" {
46+
sessionSecret = cfg.WebApp.Server.Session.Secret
4747
}
4848
return nil
4949
})
5050

5151
githubApp := GitHubApp{}
5252
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
53-
if cfg.WebApp != nil && cfg.WebApp.GithubApp != nil {
54-
githubApp.AppId = cfg.WebApp.GithubApp.AppId
55-
githubApp.AuthProviderId = cfg.WebApp.GithubApp.AuthProviderId
56-
githubApp.BaseUrl = cfg.WebApp.GithubApp.BaseUrl
57-
githubApp.CertPath = cfg.WebApp.GithubApp.CertPath
58-
githubApp.Enabled = cfg.WebApp.GithubApp.Enabled
59-
githubApp.LogLevel = cfg.WebApp.GithubApp.LogLevel
60-
githubApp.MarketplaceName = cfg.WebApp.GithubApp.MarketplaceName
61-
githubApp.WebhookSecret = cfg.WebApp.GithubApp.WebhookSecret
53+
if cfg.WebApp != nil && cfg.WebApp.Server != nil && cfg.WebApp.Server.GithubApp != nil {
54+
githubApp.AppId = cfg.WebApp.Server.GithubApp.AppId
55+
githubApp.AuthProviderId = cfg.WebApp.Server.GithubApp.AuthProviderId
56+
githubApp.BaseUrl = cfg.WebApp.Server.GithubApp.BaseUrl
57+
githubApp.CertPath = cfg.WebApp.Server.GithubApp.CertPath
58+
githubApp.Enabled = cfg.WebApp.Server.GithubApp.Enabled
59+
githubApp.LogLevel = cfg.WebApp.Server.GithubApp.LogLevel
60+
githubApp.MarketplaceName = cfg.WebApp.Server.GithubApp.MarketplaceName
61+
githubApp.WebhookSecret = cfg.WebApp.Server.GithubApp.WebhookSecret
6262
}
6363
return nil
6464
})

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,11 @@ type WorkspaceConfig struct {
5252
}
5353

5454
type WebAppConfig struct {
55-
PublicAPI *PublicAPIConfig `json:"publicApi,omitempty"`
55+
PublicAPI *PublicAPIConfig `json:"publicApi,omitempty"`
56+
Server *ServerConfig `json:"server,omitempty"`
57+
}
58+
59+
type ServerConfig struct {
5660
WorkspaceDefaults struct {
5761
WorkspaceImage string `json:"workspaceImage"`
5862
} `json:"workspaceDefaults"`

0 commit comments

Comments
 (0)