Skip to content

Commit 02a9589

Browse files
sagor999roboquat
authored andcommitted
[installer] add snapshot class into PVC config for ws-manager
1 parent 1f4e638 commit 02a9589

File tree

6 files changed

+17
-7
lines changed

6 files changed

+17
-7
lines changed

components/ws-manager-api/go/config/config.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,15 +261,17 @@ var validWorkspaceURLTemplate = validation.By(func(o interface{}) error {
261261

262262
// PVCConfiguration configures properties of persistent volume claim to use for workspace containers
263263
type PVCConfiguration struct {
264-
Size resource.Quantity `json:"size"`
265-
StorageClass string `json:"storage-class"`
264+
Size resource.Quantity `json:"size"`
265+
StorageClass string `json:"storageClass"`
266+
SnapshotClass string `json:"snapshotClass"`
266267
}
267268

268269
// Validate validates a PVC configuration
269270
func (c *PVCConfiguration) Validate() error {
270271
return validation.ValidateStruct(c,
271272
validation.Field(&c.Size, validation.Required),
272273
validation.Field(&c.StorageClass, validation.Required),
274+
validation.Field(&c.SnapshotClass, validation.Required),
273275
)
274276
}
275277

components/ws-manager/config-schema.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -134,13 +134,13 @@
134134
"PVCConfiguration": {
135135
"required": [
136136
"size",
137-
"storage-class"
137+
"storageClass"
138138
],
139139
"properties": {
140140
"size": {
141141
"type": "string"
142142
},
143-
"storage-class": {
143+
"storageClass": {
144144
"type": "string"
145145
}
146146
},

components/ws-manager/example-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
},
1818
"pvc": {
1919
"size": "30Gi",
20-
"storage-class": ""
20+
"storageClass": ""
2121
},
2222
"sync": {
2323
"image": "eu.gcr.io/gitpod-dev/gitpod-ws-daemon:cw-ws-manager.24",

install/installer/pkg/components/ws-manager/configmap.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,9 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
6969
},
7070
Templates: templatesCfg,
7171
PVC: config.PVCConfiguration{
72-
Size: ctx.Config.Workspace.PVC.Size,
73-
StorageClass: ctx.Config.Workspace.PVC.StorageClass,
72+
Size: ctx.Config.Workspace.PVC.Size,
73+
StorageClass: ctx.Config.Workspace.PVC.StorageClass,
74+
SnapshotClass: ctx.Config.Workspace.PVC.SnapshotClass,
7475
},
7576
},
7677
}

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ func (v version) Defaults(in interface{}) error {
6060
cfg.Workspace.MaxLifetime = util.Duration(36 * time.Hour)
6161
cfg.Workspace.PVC.Size = resource.MustParse("30Gi")
6262
cfg.Workspace.PVC.StorageClass = ""
63+
cfg.Workspace.PVC.SnapshotClass = ""
6364
cfg.OpenVSX.URL = "https://open-vsx.org"
6465
cfg.DisableDefinitelyGP = true
6566

@@ -246,6 +247,9 @@ type PersistentVolumeClaim struct {
246247

247248
// StorageClass is a storage class of persistent volume claim to use
248249
StorageClass string `json:"storageClass"`
250+
251+
// SnapshotClass is a snapshot class name that is used to create snapshot volume
252+
SnapshotClass string `json:"snapshotClass"`
249253
}
250254

251255
type Workspace struct {

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,9 @@ type PersistentVolumeClaim struct {
7272

7373
// StorageClass is a storage class of persistent volume claim to use
7474
StorageClass string `json:"storageClass"`
75+
76+
// SnapshotClass is a snapshot class name that is used to create snapshot volume
77+
SnapshotClass string `json:"snapshotClass"`
7578
}
7679

7780
type WorkspaceClass struct {

0 commit comments

Comments
 (0)