@@ -317,6 +317,17 @@ func createDefiniteWorkspacePod(sctx *startWorkspaceContext) (*corev1.Pod, error
317
317
},
318
318
}
319
319
320
+ if sctx .Config .EnableCustomSSLCertificate {
321
+ volumes = append (volumes , corev1.Volume {
322
+ Name : "gitpod-ca-crt" ,
323
+ VolumeSource : corev1.VolumeSource {
324
+ ConfigMap : & corev1.ConfigMapVolumeSource {
325
+ LocalObjectReference : corev1.LocalObjectReference {Name : "gitpod-customer-certificate-bundle" },
326
+ },
327
+ },
328
+ })
329
+ }
330
+
320
331
workloadType := "regular"
321
332
if sctx .Headless {
322
333
workloadType = "headless"
@@ -463,6 +474,29 @@ func createWorkspaceContainer(sctx *startWorkspaceContext) (*corev1.Container, e
463
474
464
475
image := fmt .Sprintf ("%s/%s/%s" , sctx .Config .RegistryFacadeHost , regapi .ProviderPrefixRemote , sctx .Workspace .Name )
465
476
477
+ volumeMounts := []corev1.VolumeMount {
478
+ {
479
+ Name : workspaceVolumeName ,
480
+ MountPath : workspaceDir ,
481
+ ReadOnly : false ,
482
+ MountPropagation : & mountPropagation ,
483
+ },
484
+ {
485
+ MountPath : "/.workspace" ,
486
+ Name : "daemon-mount" ,
487
+ MountPropagation : & mountPropagation ,
488
+ },
489
+ }
490
+
491
+ if sctx .Config .EnableCustomSSLCertificate {
492
+ volumeMounts = append (volumeMounts , corev1.VolumeMount {
493
+ Name : "gitpod-ca-crt" ,
494
+ MountPath : "/etc/ssl/certs/gitpod-ca.crt" ,
495
+ SubPath : "ca-certificates.crt" ,
496
+ ReadOnly : true ,
497
+ })
498
+ }
499
+
466
500
return & corev1.Container {
467
501
Name : "workspace" ,
468
502
Image : image ,
@@ -475,19 +509,7 @@ func createWorkspaceContainer(sctx *startWorkspaceContext) (*corev1.Container, e
475
509
Limits : limits ,
476
510
Requests : requests ,
477
511
},
478
- VolumeMounts : []corev1.VolumeMount {
479
- {
480
- Name : workspaceVolumeName ,
481
- MountPath : workspaceDir ,
482
- ReadOnly : false ,
483
- MountPropagation : & mountPropagation ,
484
- },
485
- {
486
- MountPath : "/.workspace" ,
487
- Name : "daemon-mount" ,
488
- MountPropagation : & mountPropagation ,
489
- },
490
- },
512
+ VolumeMounts : volumeMounts ,
491
513
ReadinessProbe : readinessProbe ,
492
514
Env : env ,
493
515
Command : command ,
@@ -547,10 +569,21 @@ func createWorkspaceEnvironment(sctx *startWorkspaceContext) ([]corev1.EnvVar, e
547
569
result = append (result , corev1.EnvVar {Name : "THEIA_WEBVIEW_EXTERNAL_ENDPOINT" , Value : "webview-{{hostname}}" })
548
570
result = append (result , corev1.EnvVar {Name : "THEIA_MINI_BROWSER_HOST_PATTERN" , Value : "browser-{{hostname}}" })
549
571
550
- // We don't require that Git be configured for workspaces
551
- if sctx .Workspace .Spec .Git != nil {
552
- result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_NAME" , Value : sctx .Workspace .Spec .Git .Username })
553
- result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_EMAIL" , Value : sctx .Workspace .Spec .Git .Email })
572
+ if sctx .Config .EnableCustomSSLCertificate {
573
+ const (
574
+ customCAMountPath = "/etc/ssl/certs/gitpod-ca.crt"
575
+ certsMountPath = "/etc/ssl/certs/"
576
+ )
577
+
578
+ result = append (result , corev1.EnvVar {Name : "NODE_EXTRA_CA_CERTS" , Value : customCAMountPath })
579
+ result = append (result , corev1.EnvVar {Name : "GIT_SSL_CAPATH" , Value : certsMountPath })
580
+ result = append (result , corev1.EnvVar {Name : "GIT_SSL_CAINFO" , Value : customCAMountPath })
581
+
582
+ // We don't require that Git be configured for workspaces
583
+ if sctx .Workspace .Spec .Git != nil {
584
+ result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_NAME" , Value : sctx .Workspace .Spec .Git .Username })
585
+ result = append (result , corev1.EnvVar {Name : "GITPOD_GIT_USER_EMAIL" , Value : sctx .Workspace .Spec .Git .Email })
586
+ }
554
587
}
555
588
556
589
// System level env vars
0 commit comments