Skip to content

Commit

Permalink
[installer] Extend workspace class info
Browse files Browse the repository at this point in the history
  • Loading branch information
Furisto committed Jul 22, 2022
1 parent 9511281 commit 44eb7a3
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 6 deletions.
9 changes: 8 additions & 1 deletion install/installer/pkg/components/server/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"fmt"
"net"
"strconv"
"strings"

"github.com/gitpod-io/gitpod/installer/pkg/common"
"github.com/gitpod-io/gitpod/installer/pkg/components/usage"
Expand Down Expand Up @@ -137,7 +138,10 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
workspaceClasses := []WorkspaceClass{
{
Id: config.DefaultWorkspaceClass,
DisplayName: config.DefaultWorkspaceClass,
Category: GeneralPurpose,
DisplayName: strings.Title(config.DefaultWorkspaceClass),
Description: "Default workspace class",
PowerUps: 1,
IsDefault: true,
Deprecated: false,
},
Expand All @@ -148,7 +152,10 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
for _, cl := range cfg.WebApp.WorkspaceClasses {
class := WorkspaceClass{
Id: cl.Id,
Category: WorkspaceClassCategory(cl.Category),
DisplayName: cl.DisplayName,
Description: cl.Description,
PowerUps: cl.PowerUps,
IsDefault: cl.IsDefault,
Deprecated: cl.Deprecated,
Marker: cl.Marker,
Expand Down
19 changes: 14 additions & 5 deletions install/installer/pkg/components/server/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,14 @@ type WorkspaceDefaults struct {
}

type WorkspaceClass struct {
Id string `json:"id"`
DisplayName string `json:"displayName"`
IsDefault bool `json:"isDefault"`
Deprecated bool `json:"deprecated"`
Marker map[string]bool `json:"marker,omitempty"`
Id string `json:"id"`
Category WorkspaceClassCategory `json:"category"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
PowerUps uint32 `json:"powerups"`
IsDefault bool `json:"isDefault"`
Deprecated bool `json:"deprecated"`
Marker map[string]bool `json:"marker,omitempty"`
}

type NamedWorkspaceFeatureFlag string
Expand All @@ -142,3 +145,9 @@ const (
NamedWorkspaceFeatureFlagFullWorkspaceBackup NamedWorkspaceFeatureFlag = "full_workspace_backup"
NamedWorkspaceFeatureFlagFixedResources NamedWorkspaceFeatureFlag = "fixed_resources"
)

type WorkspaceClassCategory string

const (
GeneralPurpose WorkspaceClassCategory = "GENERAL PURPOSE"
)
3 changes: 3 additions & 0 deletions install/installer/pkg/config/v1/experimental/experimental.go
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,10 @@ type UsageConfig struct {

type WebAppWorkspaceClass struct {
Id string `json:"id"`
Category string `json:"category"`
DisplayName string `json:"displayName"`
Description string `json:"description"`
PowerUps uint32 `json:"powerups"`
IsDefault bool `json:"isDefault"`
Deprecated bool `json:"deprecated"`
Marker map[string]bool `json:"marker,omitempty"`
Expand Down

0 comments on commit 44eb7a3

Please sign in to comment.