@@ -29,6 +29,14 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
29
29
return nil , err
30
30
}
31
31
32
+ quantityString := func (idx corev1.ResourceList , key corev1.ResourceName ) string {
33
+ q , ok := idx [key ]
34
+ if ! ok {
35
+ return ""
36
+ }
37
+ return (& q ).String ()
38
+ }
39
+
32
40
wsmcfg := config.ServiceConfiguration {
33
41
// todo(sje): put in config values
34
42
Manager : config.Configuration {
@@ -51,15 +59,20 @@ func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {
51
59
Container : config.AllContainerConfiguration {
52
60
Workspace : config.ContainerConfiguration {
53
61
Requests : config.ResourceConfiguration {
54
- CPU : "" ,
55
- Memory : "" ,
62
+ CPU : quantityString (ctx .Config .Workspace .Resources .Requests , corev1 .ResourceCPU ),
63
+ Memory : quantityString (ctx .Config .Workspace .Resources .Requests , corev1 .ResourceMemory ),
64
+ Storage : quantityString (ctx .Config .Workspace .Resources .Requests , corev1 .ResourceEphemeralStorage ),
65
+ },
66
+ Limits : config.ResourceConfiguration {
67
+ CPU : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceCPU ),
68
+ Memory : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceMemory ),
69
+ Storage : quantityString (ctx .Config .Workspace .Resources .Limits , corev1 .ResourceEphemeralStorage ),
56
70
},
57
- Limits : config.ResourceConfiguration {},
58
- Image : "OVERWRITTEN-IN-REQUEST" ,
71
+ Image : "OVERWRITTEN-IN-REQUEST" ,
59
72
},
60
73
},
61
74
HeartbeatInterval : util .Duration (30 * time .Second ),
62
- GitpodHostURL : "https://" ,
75
+ GitpodHostURL : "https://" + ctx . Config . Domain ,
63
76
WorkspaceClusterHost : "" ,
64
77
InitProbe : config.InitProbeConfiguration {
65
78
Timeout : (1 * time .Second ).String (),
0 commit comments